org.simantics.scl.runtime.string,
org.simantics.scl.runtime.tuple,
org.simantics.scl.runtime.unification,
+ org.simantics.scl.runtime.utils,
org.simantics.scl.runtime.xml
Require-Bundle: org.junit;bundle-version="4.12.0";resolution:=optional,
gnu.trove3;bundle-version="3.0.0",
+importJava "org.simantics.scl.runtime.utils.AssertionUtils" where
+ assertMultiLineStringEquals :: String -> String -> String -> <Proc> ()
+
importJava "org.junit.Assert" where
@JavaName assertEquals
@private
@JavaName assertEquals
@private
assertLongsEquals :: String -> Long -> Long -> <Proc> ()
+ @JavaName assertEquals
+ assertObjectsEquals :: String -> a -> a -> <Proc> ()
assertTrue :: String -> Boolean -> <Proc> ()
assertFalse :: String -> Boolean -> <Proc> ()
--- /dev/null
+package org.simantics.scl.runtime.utils;
+
+import org.junit.Assert;
+
+public class AssertionUtils {
+
+ public static void assertMultiLineStringEquals(String message, String expected, String actual) {
+ String[] expectedLines = expected.split("\\n");
+ String[] actualLines = actual.split("\\n");
+ for (int line = 0; line < expectedLines.length; line++) {
+ String expectedLine = expectedLines[line];
+ String actualLine = actualLines[line];
+ Assert.assertEquals(message + " Line [" + line + "]", expectedLine, actualLine);
+ }
+ }
+}
import org.junit.runner.Description;
import org.junit.runner.Runner;
-import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunNotifier;
import org.simantics.tests.modelled.utils.ModelledSTSTest;
import org.simantics.tests.modelled.utils.ModelledSTSTest.CommandSessionVariable;
@Override
public Description getDescription() {
if (description == null)
- description = Description.createTestDescription(ModelledSTSTestRunner.class, test.getName());
+ description = Description.createTestDescription(ModelledSTSTestRunner.class.getName(), test.getName(), new Integer(test.hashCode()));
return description;
}
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.regex.Pattern;
import org.simantics.scl.compiler.commands.CommandSession;
import org.simantics.scl.compiler.commands.TestScriptExecutor;
public boolean resolveDependency(String testDep) {
return unresolvedDependencies.remove(testDep);
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((code == null) ? 0 : code.hashCode());
+ result = prime * result + ((coverage == null) ? 0 : coverage.hashCode());
+ result = prime * result + ((dependencies == null) ? 0 : dependencies.hashCode());
+ result = prime * result + (ignored ? 1231 : 1237);
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + priority;
+ result = prime * result + ((unresolvedDependencies == null) ? 0 : unresolvedDependencies.hashCode());
+ result = prime * result + ((variables == null) ? 0 : variables.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ModelledSTSTest other = (ModelledSTSTest) obj;
+ if (code == null) {
+ if (other.code != null)
+ return false;
+ } else if (!code.equals(other.code))
+ return false;
+ if (coverage == null) {
+ if (other.coverage != null)
+ return false;
+ } else if (!coverage.equals(other.coverage))
+ return false;
+ if (dependencies == null) {
+ if (other.dependencies != null)
+ return false;
+ } else if (!dependencies.equals(other.dependencies))
+ return false;
+ if (ignored != other.ignored)
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (priority != other.priority)
+ return false;
+ if (unresolvedDependencies == null) {
+ if (other.unresolvedDependencies != null)
+ return false;
+ } else if (!unresolvedDependencies.equals(other.unresolvedDependencies))
+ return false;
+ if (variables == null) {
+ if (other.variables != null)
+ return false;
+ } else if (!variables.equals(other.variables))
+ return false;
+ return true;
+ }
}