diff --git a/src/main/java/li/strolch/model/AbstractStrolchElement.java b/src/main/java/li/strolch/model/AbstractStrolchElement.java index 110fa2803..44783903d 100644 --- a/src/main/java/li/strolch/model/AbstractStrolchElement.java +++ b/src/main/java/li/strolch/model/AbstractStrolchElement.java @@ -45,8 +45,10 @@ public abstract class AbstractStrolchElement implements StrolchElement { /** * Default constructor * - * @param id id of this {@link StrolchElement} - * @param name name of this {@link StrolchElement} + * @param id + * id of this {@link StrolchElement} + * @param name + * name of this {@link StrolchElement} */ public AbstractStrolchElement(String id, String name) { setId(id); @@ -97,8 +99,8 @@ public abstract class AbstractStrolchElement implements StrolchElement { * Used to build a {@link Locator} for this {@link StrolchElement}. It must be implemented by the concrete * implemented as parents must first add their {@link Locator} information * - * @param locatorBuilder the {@link LocatorBuilder} to which the {@link StrolchElement} must add its locator - * information + * @param locatorBuilder + * the {@link LocatorBuilder} to which the {@link StrolchElement} must add its locator information */ protected abstract void fillLocator(LocatorBuilder locatorBuilder); diff --git a/src/main/java/li/strolch/model/ModelGenerator.java b/src/main/java/li/strolch/model/ModelGenerator.java index 56652c47d..701b9a248 100644 --- a/src/main/java/li/strolch/model/ModelGenerator.java +++ b/src/main/java/li/strolch/model/ModelGenerator.java @@ -230,7 +230,7 @@ public class ModelGenerator { List resources = new ArrayList<>(); for (int i = 0; i < count; i++) { String id = StringHelper.normalizeLength(String.valueOf((i + idStart)), 8, true, '0'); - resources.add(createResource(idPrefix + "_" + id, name + " " + i, type)); + resources.add(createResource(idPrefix + id, name + " " + i, type)); } return resources; } @@ -299,7 +299,7 @@ public class ModelGenerator { List orders = new ArrayList<>(); for (int i = 0; i < count; i++) { String id = StringHelper.normalizeLength(String.valueOf((i + idStart)), 8, true, '0'); - orders.add(createOrder(idPrefix + "_" + id, name + " " + i, type)); + orders.add(createOrder(idPrefix + id, name + " " + i, type)); } return orders; } diff --git a/src/main/java/li/strolch/model/ModelStatistics.java b/src/main/java/li/strolch/model/ModelStatistics.java index d3a04bd4c..32315e47e 100644 --- a/src/main/java/li/strolch/model/ModelStatistics.java +++ b/src/main/java/li/strolch/model/ModelStatistics.java @@ -36,8 +36,7 @@ public class ModelStatistics { public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getClass().getSimpleName() + " [startTime="); - builder.append(this.startTime == null ? NULL : ISO8601FormatFactory.getInstance() - .formatDate(this.startTime)); + builder.append(this.startTime == null ? NULL : ISO8601FormatFactory.getInstance().formatDate(this.startTime)); builder.append(", durationNanos="); builder.append(StringHelper.formatNanoDuration(this.durationNanos)); builder.append(", nrOfResources="); diff --git a/src/main/java/li/strolch/model/ParameterizedElement.java b/src/main/java/li/strolch/model/ParameterizedElement.java index b73655b6c..ac6270fbe 100644 --- a/src/main/java/li/strolch/model/ParameterizedElement.java +++ b/src/main/java/li/strolch/model/ParameterizedElement.java @@ -215,7 +215,7 @@ public abstract class ParameterizedElement extends AbstractStrolchElement { Element paramElement = (Element) parameterElements.item(i); String paramtype = paramElement.getAttribute(Tags.TYPE); - DBC.PRE.assertNotEmpty("Type must be set on Parameter for bag with id " + id, paramtype); + DBC.PRE.assertNotEmpty("Type must be set on Parameter for bag with id " + this.id, paramtype); if (paramtype.equals(StringParameter.TYPE)) { StringParameter param = new StringParameter(paramElement); diff --git a/src/main/java/li/strolch/model/Resource.java b/src/main/java/li/strolch/model/Resource.java index 3fe1d7597..1a535a4b6 100644 --- a/src/main/java/li/strolch/model/Resource.java +++ b/src/main/java/li/strolch/model/Resource.java @@ -80,7 +80,7 @@ public class Resource extends GroupedParameterizedElement implements StrolchRoot Element timedStateElem = (Element) timedStateElems.item(i); String typeS = timedStateElem.getAttribute(Tags.TYPE); - DBC.PRE.assertNotEmpty("Type must be set on TimedState for resource with id " + id, typeS); + DBC.PRE.assertNotEmpty("Type must be set on TimedState for resource with id " + this.id, typeS); if (typeS.equals(FloatTimedState.TYPE)) { FloatTimedState timedState = new FloatTimedState(timedStateElem); diff --git a/src/main/java/li/strolch/model/StrolchElement.java b/src/main/java/li/strolch/model/StrolchElement.java index 85f171a21..1fb148ffc 100644 --- a/src/main/java/li/strolch/model/StrolchElement.java +++ b/src/main/java/li/strolch/model/StrolchElement.java @@ -79,8 +79,9 @@ public interface StrolchElement extends Serializable, Comparable /** * Returns an {@link Element} object which is an XML representation of this object * - * @param doc the document to which this element is being written. The client must not append to the document, the - * caller will perform this as needed + * @param doc + * the document to which this element is being written. The client must not append to the document, the + * caller will perform this as needed * * @return */ diff --git a/src/main/java/li/strolch/model/StrolchModelConstants.java b/src/main/java/li/strolch/model/StrolchModelConstants.java index 9db2dd829..5b9caedf2 100644 --- a/src/main/java/li/strolch/model/StrolchModelConstants.java +++ b/src/main/java/li/strolch/model/StrolchModelConstants.java @@ -20,7 +20,6 @@ public class StrolchModelConstants { * to an {@link Order} */ public static final String INTERPRETATION_ORDER_REF = "Order-Ref"; //$NON-NLS-1$ - /** * This interpretation value indicates that the {@link Parameter} has no defined interpretation diff --git a/src/main/java/li/strolch/model/audit/AuditQuery.java b/src/main/java/li/strolch/model/audit/AuditQuery.java index 840d8f785..54dcf4914 100644 --- a/src/main/java/li/strolch/model/audit/AuditQuery.java +++ b/src/main/java/li/strolch/model/audit/AuditQuery.java @@ -68,7 +68,7 @@ public class AuditQuery implements StrolchQuery { DBC.PRE.assertNotNull("No elementTypeSelection (navigation) set!", this.elementTypeSelection); //$NON-NLS-1$ DBC.PRE.assertNotNull("No dateRange set!", this.dateRange); //$NON-NLS-1$ visitor.visit(this); - for (AuditSelection selection : selections) { + for (AuditSelection selection : this.selections) { selection.accept(visitor); } } diff --git a/src/main/java/li/strolch/model/parameter/ListParameter.java b/src/main/java/li/strolch/model/parameter/ListParameter.java index 149b91c8d..d599bb29b 100644 --- a/src/main/java/li/strolch/model/parameter/ListParameter.java +++ b/src/main/java/li/strolch/model/parameter/ListParameter.java @@ -28,14 +28,16 @@ public interface ListParameter extends Parameter> { /** * Adds a single value to the {@link List} of values * - * @param value the value to add + * @param value + * the value to add */ public void addValue(E value); /** * Removes a single value from the {@link List} of values * - * @param value the value to remove + * @param value + * the value to remove * * @return true if the value was removed, false if it did not exist */ diff --git a/src/main/java/li/strolch/model/query/NotSelection.java b/src/main/java/li/strolch/model/query/NotSelection.java index 195ae6b86..a6ea2e0cf 100644 --- a/src/main/java/li/strolch/model/query/NotSelection.java +++ b/src/main/java/li/strolch/model/query/NotSelection.java @@ -28,7 +28,8 @@ public class NotSelection extends BooleanSelection { } /** - * @throws UnsupportedOperationException because a {@link NotSelection} can only work on a single {@link Selection} + * @throws UnsupportedOperationException + * because a {@link NotSelection} can only work on a single {@link Selection} */ @Override public NotSelection with(Selection selection) { diff --git a/src/main/java/li/strolch/model/query/ParameterBagSelection.java b/src/main/java/li/strolch/model/query/ParameterBagSelection.java index 3ed626da0..c1910d2ea 100644 --- a/src/main/java/li/strolch/model/query/ParameterBagSelection.java +++ b/src/main/java/li/strolch/model/query/ParameterBagSelection.java @@ -63,6 +63,7 @@ public class ParameterBagSelection implements Selection { super(bagKey); } + @Override public void accept(StrolchRootElementSelectionVisitor visitor) { visitor.visit(this); } diff --git a/src/main/java/li/strolch/model/query/QueryVisitor.java b/src/main/java/li/strolch/model/query/QueryVisitor.java index 3c92a0109..0209ae2bc 100644 --- a/src/main/java/li/strolch/model/query/QueryVisitor.java +++ b/src/main/java/li/strolch/model/query/QueryVisitor.java @@ -21,7 +21,7 @@ package li.strolch.model.query; public interface QueryVisitor { public void visitAny(); - + public void visitAnd(AndSelection andSelection); public void visitOr(OrSelection orSelection); diff --git a/src/main/java/li/strolch/model/query/StringSelection.java b/src/main/java/li/strolch/model/query/StringSelection.java index 8fa00902a..f5fa5d39a 100644 --- a/src/main/java/li/strolch/model/query/StringSelection.java +++ b/src/main/java/li/strolch/model/query/StringSelection.java @@ -76,7 +76,7 @@ public class StringSelection { } public boolean matches(String value) { - for (String sel : values) { + for (String sel : this.values) { if (this.matchMode.matches(value, sel)) return true; } diff --git a/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java b/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java index 725570c51..13f3474a7 100644 --- a/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java +++ b/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java @@ -16,10 +16,12 @@ package li.strolch.model.timedstate; import java.util.SortedSet; + import li.strolch.model.StrolchElement; import li.strolch.model.Tags; import li.strolch.model.timevalue.ITimeValue; import li.strolch.model.timevalue.impl.BooleanValue; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/src/main/java/li/strolch/model/timedstate/FloatTimedState.java b/src/main/java/li/strolch/model/timedstate/FloatTimedState.java index 4a6c90713..a82960ba3 100644 --- a/src/main/java/li/strolch/model/timedstate/FloatTimedState.java +++ b/src/main/java/li/strolch/model/timedstate/FloatTimedState.java @@ -16,10 +16,12 @@ package li.strolch.model.timedstate; import java.util.SortedSet; + import li.strolch.model.StrolchElement; import li.strolch.model.Tags; import li.strolch.model.timevalue.ITimeValue; import li.strolch.model.timevalue.impl.FloatValue; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/src/main/java/li/strolch/model/timedstate/ITimedState.java b/src/main/java/li/strolch/model/timedstate/ITimedState.java index 42e765f17..e1e60a2be 100644 --- a/src/main/java/li/strolch/model/timedstate/ITimedState.java +++ b/src/main/java/li/strolch/model/timedstate/ITimedState.java @@ -25,7 +25,8 @@ import li.strolch.model.timevalue.IValueChange; * * @author Martin Smock * - * @param IValue implementation representing the state at a given time + * @param + * IValue implementation representing the state at a given time */ @SuppressWarnings("rawtypes") public interface ITimedState { @@ -41,7 +42,8 @@ public interface ITimedState { ITimeValue getPreviousMatch(final Long time, T value); /** - * @param change the state change to be applied + * @param change + * the state change to be applied */ > void applyChange(final U change); diff --git a/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java b/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java index 220c53b0b..8cd771412 100644 --- a/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java +++ b/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java @@ -16,10 +16,12 @@ package li.strolch.model.timedstate; import java.util.SortedSet; + import li.strolch.model.StrolchElement; import li.strolch.model.Tags; import li.strolch.model.timevalue.ITimeValue; import li.strolch.model.timevalue.impl.IntegerValue; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java b/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java index 99193c401..76c202e56 100644 --- a/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java +++ b/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java @@ -19,11 +19,13 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.SortedSet; + import li.strolch.model.StrolchElement; import li.strolch.model.Tags; import li.strolch.model.timevalue.ITimeValue; import li.strolch.model.timevalue.impl.AString; import li.strolch.model.timevalue.impl.StringSetValue; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; diff --git a/src/main/java/li/strolch/model/timevalue/ITimeValue.java b/src/main/java/li/strolch/model/timevalue/ITimeValue.java index 97e9c9643..32f0478e7 100644 --- a/src/main/java/li/strolch/model/timevalue/ITimeValue.java +++ b/src/main/java/li/strolch/model/timevalue/ITimeValue.java @@ -22,7 +22,8 @@ import li.strolch.model.timevalue.impl.TimeVariable; * * @author Martin Smock * - * @param the backing value of the timed value object + * @param + * the backing value of the timed value object */ @SuppressWarnings("rawtypes") public interface ITimeValue extends Comparable> { diff --git a/src/main/java/li/strolch/model/timevalue/ITimeVariable.java b/src/main/java/li/strolch/model/timevalue/ITimeVariable.java index f16f9aeb8..d3e68b804 100644 --- a/src/main/java/li/strolch/model/timevalue/ITimeVariable.java +++ b/src/main/java/li/strolch/model/timevalue/ITimeVariable.java @@ -23,7 +23,8 @@ import java.util.SortedSet; * * @author Martin Smock * - * @param the backing value of the timed value object + * @param + * the backing value of the timed value object */ @SuppressWarnings("rawtypes") public interface ITimeVariable { @@ -31,8 +32,10 @@ public interface ITimeVariable { /** * set the value at a point in time to a given time value object * - * @param time the time to set the {@link IValue} - * @param value the {@link IValue} to set + * @param time + * the time to set the {@link IValue} + * @param value + * the {@link IValue} to set */ void setValueAt(final Long time, final T value); @@ -44,14 +47,16 @@ public interface ITimeVariable { /** * Applies a {@link IValueChange} propagating the change to all future values starting from the time of the change. * - * @param change the {@link IValueChange} to be applied + * @param change + * the {@link IValueChange} to be applied */ void applyChange(final IValueChange change); /** * Get all {@link ITimeValue} objects whose time field is greater or equal to the given time * - * @param time the time the sequence starts with + * @param time + * the time the sequence starts with * @return the sequence of {@link ITimeValue} objects in the future */ Collection> getFutureValues(final Long time); @@ -59,7 +64,8 @@ public interface ITimeVariable { /** * Get all {@link ITimeValue} objects whose time field is strictly smaller than the given time * - * @param time the time the sequence starts with + * @param time + * the time the sequence starts with * @return the sequence of {@link ITimeValue} objects in the future */ Collection> getPastValues(final Long time); diff --git a/src/main/java/li/strolch/model/timevalue/IValue.java b/src/main/java/li/strolch/model/timevalue/IValue.java index 701d62d8d..2c33a262d 100644 --- a/src/main/java/li/strolch/model/timevalue/IValue.java +++ b/src/main/java/li/strolch/model/timevalue/IValue.java @@ -21,7 +21,8 @@ package li.strolch.model.timevalue; * * @author Martin Smock * - * @param any object for which a (generalized) add operation can be defined. + * @param + * any object for which a (generalized) add operation can be defined. */ public interface IValue { @@ -49,7 +50,7 @@ public interface IValue { * @return a copy of this */ IValue getCopy(); - + /** * @return this value in string representation */ diff --git a/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java b/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java index f52a1c794..4e00f603c 100644 --- a/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java +++ b/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java @@ -65,7 +65,7 @@ public class BooleanValue implements IValue, Serializable { public BooleanValue getInverse() { return new BooleanValue(!getValue()); } - + @Override public String getValueAsString() { return this.value.toString(); diff --git a/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java b/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java index 4f90363e2..c1476273f 100644 --- a/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java +++ b/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java @@ -65,7 +65,7 @@ public class IntegerValue implements IValue, Serializable { public IntegerValue getInverse() { return new IntegerValue(-getValue()); } - + @Override public String getValueAsString() { return this.value.toString(); diff --git a/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java b/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java index b6eb46df4..e17c590c7 100644 --- a/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java +++ b/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java @@ -110,7 +110,7 @@ public class StringSetValue implements IValue>, Serializable { return this.aStrings.iterator().next().getString(); StringBuilder sb = new StringBuilder(); - Iterator iter = aStrings.iterator(); + Iterator iter = this.aStrings.iterator(); while (iter.hasNext()) { sb.append(iter.next()); if (iter.hasNext()) diff --git a/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java b/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java index 9af00ffe2..3ffec7a36 100644 --- a/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java +++ b/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java @@ -72,7 +72,7 @@ public class TimeValue implements ITimeValue, Serializable @SuppressWarnings("unchecked") @Override public ITimeValue getCopy() { - return new TimeValue(time, (T) value.getCopy()); + return new TimeValue(this.time, (T) this.value.getCopy()); } @SuppressWarnings("nls") diff --git a/src/main/java/li/strolch/model/xml/AbstractToSaxWriterVisitor.java b/src/main/java/li/strolch/model/xml/AbstractToSaxWriterVisitor.java index 5a53a9497..9f50deaf4 100644 --- a/src/main/java/li/strolch/model/xml/AbstractToSaxWriterVisitor.java +++ b/src/main/java/li/strolch/model/xml/AbstractToSaxWriterVisitor.java @@ -56,14 +56,14 @@ public abstract class AbstractToSaxWriterVisitor { protected void writeElement(String tag, Order order) throws XMLStreamException { boolean empty = !order.hasParameterBags(); - writeElement(tag, empty, (GroupedParameterizedElement) order); + writeElement(tag, empty, order); if (!empty) this.writer.writeEndElement(); } protected void writeElement(String tag, Resource resource) throws XMLStreamException { boolean empty = !resource.hasParameterBags() && !resource.hasTimedStates(); - writeElement(tag, empty, (GroupedParameterizedElement) resource); + writeElement(tag, empty, resource); if (resource.hasTimedStates()) writeTimedStates(resource); @@ -85,13 +85,13 @@ public abstract class AbstractToSaxWriterVisitor { writeStartStrolchElement(Tags.TIMED_STATE, !values.isEmpty(), timedState); for (ITimeValue> timeValue : values) { - writer.writeEmptyElement(Tags.VALUE); - writer.writeAttribute(Tags.TIME, timeValue.getTime().toString()); - writer.writeAttribute(Tags.VALUE, timeValue.getValue().getValueAsString()); + this.writer.writeEmptyElement(Tags.VALUE); + this.writer.writeAttribute(Tags.TIME, timeValue.getTime().toString()); + this.writer.writeAttribute(Tags.VALUE, timeValue.getValue().getValueAsString()); } if (!values.isEmpty()) - writer.writeEndElement(); + this.writer.writeEndElement(); } } diff --git a/src/main/java/li/strolch/model/xml/XmlModelSaxFileReader.java b/src/main/java/li/strolch/model/xml/XmlModelSaxFileReader.java index a515767b6..e87059b6f 100644 --- a/src/main/java/li/strolch/model/xml/XmlModelSaxFileReader.java +++ b/src/main/java/li/strolch/model/xml/XmlModelSaxFileReader.java @@ -54,28 +54,28 @@ public class XmlModelSaxFileReader extends XmlModelSaxReader { switch (qName) { - case Tags.INCLUDE_FILE: + case Tags.INCLUDE_FILE: - String includeFileS = attributes.getValue(Tags.FILE); - if (StringHelper.isEmpty(includeFileS)) { - throw new IllegalArgumentException(MessageFormat.format( - "The attribute {0} is missing for IncludeFile!", Tags.FILE)); //$NON-NLS-1$ - } - File includeFile = new File(this.modelFile.getParentFile(), includeFileS); - if (!includeFile.exists() || !includeFile.canRead()) { - String msg = "The IncludeFile does not exist, or is not readable. Source model: {0} with IncludeFile: {1}"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, this.modelFile.getName(), includeFileS); - throw new IllegalArgumentException(msg); - } + String includeFileS = attributes.getValue(Tags.FILE); + if (StringHelper.isEmpty(includeFileS)) { + throw new IllegalArgumentException(MessageFormat.format( + "The attribute {0} is missing for IncludeFile!", Tags.FILE)); //$NON-NLS-1$ + } + File includeFile = new File(this.modelFile.getParentFile(), includeFileS); + if (!includeFile.exists() || !includeFile.canRead()) { + String msg = "The IncludeFile does not exist, or is not readable. Source model: {0} with IncludeFile: {1}"; //$NON-NLS-1$ + msg = MessageFormat.format(msg, this.modelFile.getName(), includeFileS); + throw new IllegalArgumentException(msg); + } - XmlModelSaxFileReader handler = new XmlModelSaxFileReader(this.listener, includeFile); - handler.parseFile(); - this.statistics.nrOfOrders += handler.statistics.nrOfOrders; - this.statistics.nrOfResources += handler.statistics.nrOfResources; + XmlModelSaxFileReader handler = new XmlModelSaxFileReader(this.listener, includeFile); + handler.parseFile(); + this.statistics.nrOfOrders += handler.statistics.nrOfOrders; + this.statistics.nrOfResources += handler.statistics.nrOfResources; - break; - default: - super.startElement(uri, localName, qName, attributes); + break; + default: + super.startElement(uri, localName, qName, attributes); } } diff --git a/src/main/java/li/strolch/model/xml/XmlModelSaxReader.java b/src/main/java/li/strolch/model/xml/XmlModelSaxReader.java index 70287df8f..61ea31067 100644 --- a/src/main/java/li/strolch/model/xml/XmlModelSaxReader.java +++ b/src/main/java/li/strolch/model/xml/XmlModelSaxReader.java @@ -266,7 +266,7 @@ public class XmlModelSaxReader extends DefaultHandler { case Tags.INCLUDE_FILE: break; case Tags.TIMED_STATE: - ((Resource) this.parameterizedElement).addTimedState(state); + ((Resource) this.parameterizedElement).addTimedState(this.state); break; case Tags.VALUE: break; diff --git a/src/test/java/li/strolch/model/ModelTest.java b/src/test/java/li/strolch/model/ModelTest.java index 0a512ba56..ce2fd43f0 100644 --- a/src/test/java/li/strolch/model/ModelTest.java +++ b/src/test/java/li/strolch/model/ModelTest.java @@ -15,7 +15,46 @@ */ package li.strolch.model; -import static li.strolch.model.ModelGenerator.*; +import static li.strolch.model.ModelGenerator.BAG_ID; +import static li.strolch.model.ModelGenerator.BAG_NAME; +import static li.strolch.model.ModelGenerator.BAG_TYPE; +import static li.strolch.model.ModelGenerator.PARAM_BOOLEAN_ID; +import static li.strolch.model.ModelGenerator.PARAM_DATE_ID; +import static li.strolch.model.ModelGenerator.PARAM_FLOAT_ID; +import static li.strolch.model.ModelGenerator.PARAM_INTEGER_ID; +import static li.strolch.model.ModelGenerator.PARAM_LIST_STRING_ID; +import static li.strolch.model.ModelGenerator.PARAM_LONG_ID; +import static li.strolch.model.ModelGenerator.PARAM_STRING_ID; +import static li.strolch.model.ModelGenerator.STATE_BOOLEAN_ID; +import static li.strolch.model.ModelGenerator.STATE_BOOLEAN_TIME_0; +import static li.strolch.model.ModelGenerator.STATE_BOOLEAN_TIME_10; +import static li.strolch.model.ModelGenerator.STATE_BOOLEAN_TIME_20; +import static li.strolch.model.ModelGenerator.STATE_BOOLEAN_TIME_30; +import static li.strolch.model.ModelGenerator.STATE_FLOAT_ID; +import static li.strolch.model.ModelGenerator.STATE_FLOAT_TIME_0; +import static li.strolch.model.ModelGenerator.STATE_FLOAT_TIME_10; +import static li.strolch.model.ModelGenerator.STATE_FLOAT_TIME_20; +import static li.strolch.model.ModelGenerator.STATE_FLOAT_TIME_30; +import static li.strolch.model.ModelGenerator.STATE_INTEGER_ID; +import static li.strolch.model.ModelGenerator.STATE_INTEGER_TIME_0; +import static li.strolch.model.ModelGenerator.STATE_INTEGER_TIME_10; +import static li.strolch.model.ModelGenerator.STATE_INTEGER_TIME_20; +import static li.strolch.model.ModelGenerator.STATE_INTEGER_TIME_30; +import static li.strolch.model.ModelGenerator.STATE_STRING_ID; +import static li.strolch.model.ModelGenerator.STATE_STRING_TIME_0; +import static li.strolch.model.ModelGenerator.STATE_STRING_TIME_10; +import static li.strolch.model.ModelGenerator.STATE_STRING_TIME_20; +import static li.strolch.model.ModelGenerator.STATE_STRING_TIME_30; +import static li.strolch.model.ModelGenerator.STATE_TIME_0; +import static li.strolch.model.ModelGenerator.STATE_TIME_10; +import static li.strolch.model.ModelGenerator.STATE_TIME_20; +import static li.strolch.model.ModelGenerator.STATE_TIME_30; +import static li.strolch.model.ModelGenerator.createOrder; +import static li.strolch.model.ModelGenerator.createResource; +import static li.strolch.model.Tags.BAG; +import static li.strolch.model.Tags.ORDER; +import static li.strolch.model.Tags.RESOURCE; +import static li.strolch.model.Tags.STATE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -23,7 +62,7 @@ import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.Date; -import static li.strolch.model.Tags.*; + import li.strolch.model.parameter.BooleanParameter; import li.strolch.model.parameter.DateParameter; import li.strolch.model.parameter.FloatParameter; diff --git a/src/test/java/li/strolch/model/XmlToDomTest.java b/src/test/java/li/strolch/model/XmlToDomTest.java index e6417b494..ecbd00fa8 100644 --- a/src/test/java/li/strolch/model/XmlToDomTest.java +++ b/src/test/java/li/strolch/model/XmlToDomTest.java @@ -15,11 +15,12 @@ */ package li.strolch.model; +import static org.junit.Assert.assertTrue; import li.strolch.model.visitor.OrderDeepEqualsVisitor; import li.strolch.model.visitor.ResourceDeepEqualsVisitor; import li.strolch.model.xml.OrderToDomVisitor; import li.strolch.model.xml.ResourceToDomVisitor; -import static org.junit.Assert.assertTrue; + import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -45,8 +46,7 @@ public class XmlToDomTest extends ModelTest { OrderDeepEqualsVisitor visitor = new OrderDeepEqualsVisitor(order); visitor.visit(parsedOrder); - assertTrue("To DOM and back should equal same Order:\n" + visitor.getMismatchedLocators(), - visitor.isEqual()); + assertTrue("To DOM and back should equal same Order:\n" + visitor.getMismatchedLocators(), visitor.isEqual()); } @Test @@ -63,7 +63,6 @@ public class XmlToDomTest extends ModelTest { ResourceDeepEqualsVisitor visitor = new ResourceDeepEqualsVisitor(resource); visitor.visit(parsedResource); - assertTrue("To DOM and back should equal same Resource:\n" + visitor.getMismatchedLocators(), - visitor.isEqual()); + assertTrue("To DOM and back should equal same Resource:\n" + visitor.getMismatchedLocators(), visitor.isEqual()); } } diff --git a/src/test/java/li/strolch/model/timedstate/StrolchTimedStateTest.java b/src/test/java/li/strolch/model/timedstate/StrolchTimedStateTest.java index b020b88c9..1cbd914b3 100644 --- a/src/test/java/li/strolch/model/timedstate/StrolchTimedStateTest.java +++ b/src/test/java/li/strolch/model/timedstate/StrolchTimedStateTest.java @@ -15,8 +15,11 @@ */ package li.strolch.model.timedstate; +import static org.junit.Assert.assertEquals; + import java.util.HashSet; import java.util.Set; + import li.strolch.model.ModelGenerator; import li.strolch.model.Resource; import li.strolch.model.timevalue.ITimeValue; @@ -25,7 +28,7 @@ import li.strolch.model.timevalue.impl.BooleanValue; import li.strolch.model.timevalue.impl.FloatValue; import li.strolch.model.timevalue.impl.IntegerValue; import li.strolch.model.timevalue.impl.StringSetValue; -import static org.junit.Assert.assertEquals; + import org.junit.Test; /**