From: Antti Villberg Date: Thu, 20 Feb 2020 09:20:46 +0000 (+0200) Subject: Simantics integration STS X-Git-Tag: v1.43.0~90 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F3887%2F5;p=simantics%2Fplatform.git Simantics integration STS gitlab #472 Change-Id: Ic65e158b277f7a1a9b4ce788f95f4dec5ab89ac4 --- diff --git a/bundles/org.simantics.tests.modelled.ontology/graph/Tests.pgraph b/bundles/org.simantics.tests.modelled.ontology/graph/Tests.pgraph index 59d9e578c..5f5012861 100644 --- a/bundles/org.simantics.tests.modelled.ontology/graph/Tests.pgraph +++ b/bundles/org.simantics.tests.modelled.ontology/graph/Tests.pgraph @@ -7,8 +7,8 @@ TESTS = : L0.Ontology L0.HasResourceClass "org.simantics.tests.modelled.ontology.TestsResource" TESTS.SCLMain : L0.SCLModule - L0.SCLModule.definition _ : L0.String - @L0.loadString "scl/SCLMain.scl" + L0.SCLModule.definition _ : L0.String + @L0.loadString "scl/SCLMain.scl" TESTS.STSTest.definition Vector Byte" -TESTS.STSTest : MOD.TypeWithChangeInformation +TESTS.STSTest : MOD.TypeWithChangeInformation TESTS.STSTest : L0.TypeWithIdentifier TESTS.STSSuite : L0.Ontology L0.HasResourceClass "org.simantics.tests.modelled.ui.ontology.TestsUIResource" TestsUI.SCLMain : L0.SCLModule - L0.SCLModule.definition _ : L0.String - @L0.loadString "scl/SCLMain.scl" + L0.SCLModule.definition _ : L0.String + @L0.loadString "scl/SCLMain.scl" TestsUI.testImage : IMAGE.PngImage @L0.loadBytes "images/test.png" @@ -35,6 +35,8 @@ MBC @VP.namedRelationChildRule TestsUI.Contributions.STSSuites L0.Entity L0.ConsistsOf TESTS.STSSuite @VP.namedConstantImageRule TestsUI.Contributions.SuiteImage TESTS.STSSuite TestsUI.testSuiteImage @VP.namedRelationChildRule TestsUI.Contributions.STSTests L0.Entity L0.ConsistsOf TESTS.STSTest + @VP.namedRelationChildRule TestsUI.Contributions.SuiteModules TESTS.STSSuite L0.ConsistsOf L0.SCLModule + @VP.namedRelationChildRule TestsUI.Contributions.TestModules TESTS.STSTest L0.ConsistsOf L0.SCLModule @VP.customImageRule TESTS.STSTest MBC.TestImageRule @VP.namedRelationChildRule TestsUI.Contributions.STSVariables L0.Entity L0.ConsistsOf TESTS.STSVariable @VP.namedConstantImageRule TestsUI.Contributions.VariableImage TESTS.STSVariable SILK.page_white_edit @@ -98,3 +100,11 @@ MAC VP.ActionContribution.HasNodeType TESTS.STSSuite VP.ActionContribution.HasNodeType TESTS.STSTest VP.ActionContribution.HasAction ACTIONS.NewSTSVariable + VP.BrowseContext.HasActionContribution _ : VP.ActionContribution + L0.HasLabel "SCL Module" + VP.ActionContribution.HasImage SILK.page_white_text + VP.ActionContribution.HasCategory VP.NewActionCategory + VP.ActionContribution.HasNodeType TESTS.STSSuite + VP.ActionContribution.HasNodeType TESTS.STSTest + VP.ActionContribution.HasAction MOD.ModelingActionContext.Actions.NewSCLModule + VP.ActionContribution.IsVisibleIf MOD.ModelingActionContext.Tests.IsContainerNotPublished diff --git a/bundles/org.simantics.tests.modelled.ui/src/org/simantics/tests/modelled/ui/STSSuiteSorterRule.java b/bundles/org.simantics.tests.modelled.ui/src/org/simantics/tests/modelled/ui/STSSuiteSorterRule.java index 78de04dc4..b29545df4 100644 --- a/bundles/org.simantics.tests.modelled.ui/src/org/simantics/tests/modelled/ui/STSSuiteSorterRule.java +++ b/bundles/org.simantics.tests.modelled.ui/src/org/simantics/tests/modelled/ui/STSSuiteSorterRule.java @@ -33,69 +33,72 @@ import org.simantics.utils.strings.AlphanumComparator; public class STSSuiteSorterRule implements SorterRule, Sorter { - @Override - public boolean isCompatible(Class contentType) { - return contentType.equals(Resource.class); - } - - @Override - public Sorter getSorter(ReadGraph graph, Object content) throws DatabaseException { - return this; - } - - @Override - public void sort(ReadGraph graph, BrowseContext context, List nodes) throws DatabaseException - { - try { - STSTestComparator stc = new STSTestComparator(); - stc.graph = graph; - Collections.sort(nodes, stc); - } catch (RuntimeDatabaseException e) { - if (e.getCause()!=null && e.getCause() instanceof DatabaseException) throw (DatabaseException) e.getCause(); - throw e; - } - } - - static class STSTestQuery extends ResourceRead> { - - public STSTestQuery(Resource resource) { - super(resource); - } - - @Override - public Pair perform(ReadGraph graph) throws DatabaseException { - Layer0 L0 = Layer0.getInstance(graph); - TestsResource TESTS = TestsResource.getInstance(graph); - - String name = graph.getRelatedValue2(resource, L0.HasName, Bindings.STRING); - Integer priority = graph.getRelatedValue2(resource, TESTS.STSTest_executionPriority, Bindings.INTEGER); - - return new Pair(priority, name); - } - - } - - static class STSTestComparator implements Comparator { - ReadGraph graph; - - @Override - public int compare(NodeContext nc1, NodeContext nc2) { - Resource r1 = (Resource) nc1.getConstant(BuiltinKeys.INPUT); - Resource r2 = (Resource) nc2.getConstant(BuiltinKeys.INPUT); - - try { - Pair test1 = graph.sync(new STSTestQuery(r1)); - Pair test2 = graph.sync(new STSTestQuery(r2)); + @Override + public boolean isCompatible(Class contentType) { + return contentType.equals(Resource.class); + } + + @Override + public Sorter getSorter(ReadGraph graph, Object content) throws DatabaseException { + return this; + } + + @Override + public void sort(ReadGraph graph, BrowseContext context, List nodes) throws DatabaseException + { + try { + STSTestComparator stc = new STSTestComparator(); + stc.graph = graph; + Collections.sort(nodes, stc); + } catch (RuntimeDatabaseException e) { + if (e.getCause()!=null && e.getCause() instanceof DatabaseException) throw (DatabaseException) e.getCause(); + throw e; + } + } + + static class STSTestQuery extends ResourceRead> { + + public STSTestQuery(Resource resource) { + super(resource); + } + + @Override + public Pair perform(ReadGraph graph) throws DatabaseException { + Layer0 L0 = Layer0.getInstance(graph); + TestsResource TESTS = TestsResource.getInstance(graph); + String name = graph.getRelatedValue2(resource, L0.HasName, Bindings.STRING); + if(graph.isInstanceOf(resource, TESTS.STSTest)) { + Integer priority = graph.getRelatedValue2(resource, TESTS.STSTest_executionPriority, Bindings.INTEGER); + return new Pair(priority, name); + } else { + return new Pair(0, name); + } + + } + + } + + static class STSTestComparator implements Comparator { + ReadGraph graph; + + @Override + public int compare(NodeContext nc1, NodeContext nc2) { + Resource r1 = (Resource) nc1.getConstant(BuiltinKeys.INPUT); + Resource r2 = (Resource) nc2.getConstant(BuiltinKeys.INPUT); + + try { + Pair test1 = graph.sync(new STSTestQuery(r1)); + Pair test2 = graph.sync(new STSTestQuery(r2)); if (test1.first < test2.first) return -1; else if (test1.first > test2.first) return 1; else return AlphanumComparator.COMPARATOR.compare(test1.second, test2.second); - - } catch (DatabaseException e) { - throw new RuntimeDatabaseException(e); - } - } - } + + } catch (DatabaseException e) { + throw new RuntimeDatabaseException(e); + } + } + } } diff --git a/bundles/org.simantics.tests.modelled/scl/Simantics/Tests.scl b/bundles/org.simantics.tests.modelled/scl/Simantics/Tests.scl index ce3cfb154..1d044ae60 100644 --- a/bundles/org.simantics.tests.modelled/scl/Simantics/Tests.scl +++ b/bundles/org.simantics.tests.modelled/scl/Simantics/Tests.scl @@ -4,3 +4,4 @@ importJava "org.simantics.tests.modelled.TestsGraphUtils" where createSTSTest :: Resource -> Resource createSTSSuite :: Resource -> Resource createSTSVariable :: Resource -> Resource + stsTestContentDump :: Resource -> Vector Byte diff --git a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/TestsGraphUtils.java b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/TestsGraphUtils.java index c5253bd5a..846261938 100644 --- a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/TestsGraphUtils.java +++ b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/TestsGraphUtils.java @@ -3,12 +3,14 @@ package org.simantics.tests.modelled; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.regex.Pattern; import org.simantics.databoard.Bindings; +import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.utils.NameUtils; @@ -27,49 +29,54 @@ import org.simantics.scl.osgi.SCLOsgi; import org.simantics.scl.runtime.reporting.SCLReportingHandler; import org.simantics.tests.modelled.ontology.TestsResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class TestsGraphUtils { + private static final Logger LOGGER = LoggerFactory.getLogger(TestsGraphUtils.class); + private static final String STS_TEST_PREFIX = "STSTest"; private static final String STS_SUITE_PREFIX = "STSSuite"; private static final String STS_VARIABLE_PREFIX = "STSVariable"; - + private TestsGraphUtils() {} - + public static Resource createSTSVariable(WriteGraph graph, Resource parent) throws DatabaseException { String name = NameUtils.findFreshEscapedName(graph, STS_VARIABLE_PREFIX, parent); Resource stsVariable = graph.newResource(); - + Layer0 L0 = Layer0.getInstance(graph); TestsResource TESTS = TestsResource.getInstance(graph); - + graph.claim(parent, L0.ConsistsOf, L0.PartOf, stsVariable); graph.claim(stsVariable, L0.InstanceOf, TESTS.STSVariable); graph.claimLiteral(stsVariable, L0.HasName, name, Bindings.STRING); graph.claimLiteral(stsVariable, TESTS.STSVariable_definition, "", Bindings.STRING); return stsVariable; } - + public static Resource createSTSTest(WriteGraph graph, Resource parent) throws DatabaseException { String name = NameUtils.findFreshEscapedName(graph, STS_TEST_PREFIX, parent); Resource stsTest = graph.newResource(); - + Layer0 L0 = Layer0.getInstance(graph); TestsResource TESTS = TestsResource.getInstance(graph); - + graph.claim(parent, L0.ConsistsOf, L0.PartOf, stsTest); graph.claim(stsTest, L0.InstanceOf, TESTS.STSTest); graph.claimLiteral(stsTest, L0.HasName, name, Bindings.STRING); graph.claimLiteral(stsTest, TESTS.STSTest_definition, "", Bindings.STRING); return stsTest; } - + public static Resource createSTSSuite(WriteGraph graph, Resource parent) throws DatabaseException { String name = NameUtils.findFreshEscapedName(graph, STS_SUITE_PREFIX, parent); Resource stsSuite = graph.newResource(); - + Layer0 L0 = Layer0.getInstance(graph); TestsResource TESTS = TestsResource.getInstance(graph); - + graph.claim(parent, L0.ConsistsOf, L0.PartOf, stsSuite); graph.claim(stsSuite, L0.InstanceOf, TESTS.STSSuite); graph.claimLiteral(stsSuite, L0.HasName, name, Bindings.STRING); @@ -77,11 +84,11 @@ public class TestsGraphUtils { } public static CombinedCoverage runSTSTestDefinition(String definition, List moduleNameFilters, SCLReportingHandler handler) throws IOException { - + // ModuleRepository repo = SCLOsgi.MODULE_REPOSITORY; ModuleRepository repo = new ModuleRepository(SCLOsgi.SOURCE_REPOSITORY); repo.setAdvisor(new ModuleCompilationOptionsAdvisor() { - + @Override public ModuleCompilationOptions getOptions(String moduleName) { boolean coverage = false; @@ -94,13 +101,13 @@ public class TestsGraphUtils { return new ModuleCompilationOptions(coverage); } }); - + CommandSession session = new CommandSession(repo, handler); TestScriptExecutor executor = new TestScriptExecutor(session, new BufferedReader(new StringReader(definition)), handler); try { executor.execute(); } catch (Throwable t) { - t.printStackTrace(); + LOGGER.error("Failed to execute test definition:\n{}", definition, t); } Collection runtimeModules = session.getRuntimeEnvironment().getRuntimeModules(); List modules = new ArrayList<>(runtimeModules.size()); @@ -110,4 +117,11 @@ public class TestsGraphUtils { CombinedCoverage coverage = CoverageUtils.getCoverage(modules); return coverage; } + + public static byte[] stsTestContentDump(ReadGraph graph, Resource test) throws DatabaseException { + TestsResource TESTS = TestsResource.getInstance(graph); + String def = graph.getRelatedValue(test, TESTS.STSTest_definition, Bindings.STRING); + return def.getBytes(StandardCharsets.UTF_8); + } + } diff --git a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/ModelledSTSTest.java b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/ModelledSTSTest.java index 78964403f..492f8d11a 100644 --- a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/ModelledSTSTest.java +++ b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/ModelledSTSTest.java @@ -28,18 +28,20 @@ public class ModelledSTSTest { private final String code; private final int priority; private final boolean ignored; + private Set imports; private Set dependencies; private Set unresolvedDependencies; - + private CombinedCoverage coverage; private Map variables; - ModelledSTSTest(String name, String parentName, String code, int priority, boolean ignored, Set dependencies, Map variables) { + ModelledSTSTest(String name, String parentName, String code, int priority, boolean ignored, Set imports, Set dependencies, Map variables) { this.name = name; this.parentName = parentName; this.code = code; this.priority = priority; this.ignored = ignored; + this.imports = imports; this.dependencies = dependencies; this.unresolvedDependencies = new HashSet<>(dependencies); this.variables = variables; @@ -97,14 +99,14 @@ public class ModelledSTSTest { return value; } } - + public List run(List vars) throws IOException { // ModuleRepository repo = new ModuleRepository(SCLOsgi.SOURCE_REPOSITORY); ModuleRepository repo = SCLOsgi.MODULE_REPOSITORY; CommandSession session = null; try { // repo.setAdvisor(new ModuleCompilationOptionsAdvisor() { -// +// // @Override // public ModuleCompilationOptions getOptions(String moduleName) { // // TODO: default to false @@ -119,24 +121,28 @@ public class ModelledSTSTest { // return new ModuleCompilationOptions(coverage); // } // }); - + SCLReportingHandler handler = (SCLReportingHandler) SCLContext.getCurrent().get(SCLReportingHandler.REPORTING_HANDLER); session = new CommandSession(repo, handler); - + + for(String imp : imports) { + session.execute("import \"" + imp + "\""); + } + for (CommandSessionVariable var : vars) session.setVariable(var.getName(), var.getType(), var.getValue()); - + for (Map.Entry entry : variables.entrySet()) session.setVariable(entry.getKey(), Types.STRING, entry.getValue()); - - new TestScriptExecutor(session, new BufferedReader(new StringReader(code)), handler, true).execute(); + + new TestScriptExecutor(session, new BufferedReader(new StringReader(code)), handler, false).execute(); STSSuiteTestCollector.setTestCoverage(this, session); - + // Return variables from this session List result = new ArrayList<>(); for (String var : session.getVariables()) result.add(new CommandSessionVariable(var, session.getVariableType(var), session.getVariableValue(var))); - + return result; } finally { // remember to flush this repository @@ -149,11 +155,11 @@ public class ModelledSTSTest { public Set getDependencies() { return dependencies; } - + public Set getUnresolvedDependencies() { return unresolvedDependencies; } - + public boolean resolveDependency(String testDep) { return unresolvedDependencies.remove(testDep); } @@ -164,6 +170,7 @@ public class ModelledSTSTest { int result = 1; result = prime * result + ((code == null) ? 0 : code.hashCode()); result = prime * result + ((coverage == null) ? 0 : coverage.hashCode()); + result = prime * result + ((imports == null) ? 0 : imports.hashCode()); result = prime * result + ((dependencies == null) ? 0 : dependencies.hashCode()); result = prime * result + (ignored ? 1231 : 1237); result = prime * result + ((name == null) ? 0 : name.hashCode()); @@ -192,6 +199,11 @@ public class ModelledSTSTest { return false; } else if (!coverage.equals(other.coverage)) return false; + if (imports== null) { + if (other.imports != null) + return false; + } else if (!imports.equals(other.imports)) + return false; if (dependencies == null) { if (other.dependencies != null) return false; diff --git a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/STSSuiteTestCollector.java b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/STSSuiteTestCollector.java index 56d43aec9..e04144f6d 100644 --- a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/STSSuiteTestCollector.java +++ b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/STSSuiteTestCollector.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.regex.Pattern; import org.simantics.Simantics; @@ -15,7 +16,9 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.common.request.UniqueRead; +import org.simantics.db.common.utils.CommonDBUtils; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.QueryIndexUtils; import org.simantics.layer0.Layer0; import org.simantics.modeling.ModelingUtils; import org.simantics.scl.compiler.commands.CommandSession; @@ -52,7 +55,7 @@ public class STSSuiteTestCollector { for (Resource sharedOntology : sharedOntologies) { if (LOGGER.isInfoEnabled()) LOGGER.info("Searching {} for modelled tests", graph.getURI(sharedOntology)); - List stsSuites = ModelingUtils.searchByType(graph, sharedOntology, TESTS.STSSuite); + List stsSuites = QueryIndexUtils.searchByType(graph, sharedOntology, TESTS.STSSuite); for (Resource stsSuite : stsSuites) { try { Collection tests = graph.syncRequest(new ObjectsWithType(stsSuite, L0.ConsistsOf, TESTS.STSTest)); @@ -76,7 +79,27 @@ public class STSSuiteTestCollector { } + public static void collectTestImports(ReadGraph graph, Resource resource, Set imports) throws DatabaseException { + Layer0 L0 = Layer0.getInstance(graph); + TestsResource TESTS = TestsResource.getInstance(graph); + if(graph.isInstanceOf(resource, TESTS.STSTest) || graph.isInstanceOf(resource, TESTS.STSSuite)) { + for(Resource module : CommonDBUtils.objectsWithType(graph, resource, L0.ConsistsOf, L0.SCLModule)) { + String uri = graph.getPossibleURI(module); + if(uri != null) + imports.add(uri); + } + Resource parent = graph.getPossibleObject(resource, L0.PartOf); + if(parent != null) + collectTestImports(graph, parent, imports); + } else if(graph.isInstanceOf(resource, L0.IndexRoot)) { + Resource sclMain = CommonDBUtils.getPossibleChild(graph, resource, L0.SCLModule, "SCLMain"); + if(sclMain != null) + imports.add(graph.getURI(sclMain)); + } + } + public static ModelledSTSTest toModelledTest(ReadGraph graph, Resource test) throws DatabaseException { + Layer0 L0 = Layer0.getInstance(graph); TestsResource TESTS = TestsResource.getInstance(graph); String testName = graph.getRelatedValue(test, L0.HasName, Bindings.STRING); @@ -88,13 +111,17 @@ public class STSSuiteTestCollector { String[] actualDeps = dependencies.isEmpty() ? new String[0] : dependencies.split(","); // collect variables - Collection stsVariables = graph.getObjects(test, L0.ConsistsOf); + Collection stsVariables = CommonDBUtils.objectsWithType(graph, test, L0.ConsistsOf, TESTS.STSVariable); Map variables = new HashMap<>(stsVariables.size()); for (Resource stsVariable : stsVariables) { String name = graph.getRelatedValue(stsVariable, L0.HasName, Bindings.STRING); String value = graph.getRelatedValue(stsVariable, TESTS.STSVariable_definition); variables.put(name, value); } + + Set imports = new HashSet<>(); + collectTestImports(graph, test, imports); + Resource parent = graph.getSingleObject(test, L0.PartOf); String parentName; String possibleURI = graph.getPossibleURI(parent); @@ -102,7 +129,8 @@ public class STSSuiteTestCollector { parentName = possibleURI; else parentName = graph.getRelatedValue2(parent, L0.HasName, Bindings.STRING); - return new ModelledSTSTest(testName, parentName, code, priority != null ? priority : -1, ignored != null ? ignored : false, new HashSet<>(Arrays.asList(actualDeps)), variables); + return new ModelledSTSTest(testName, parentName, code, priority != null ? priority : -1, ignored != null ? ignored : false, imports, new HashSet<>(Arrays.asList(actualDeps)), variables); + } public static ModelledSTSSuite toModelledSuite(ReadGraph graph, Resource suite, List children) throws DatabaseException { diff --git a/tests/org.simantics.tests.integration/.classpath b/tests/org.simantics.tests.integration/.classpath new file mode 100644 index 000000000..4058b66fe --- /dev/null +++ b/tests/org.simantics.tests.integration/.classpath @@ -0,0 +1,9 @@ + + + + + + + diff --git a/tests/org.simantics.tests.integration/.project b/tests/org.simantics.tests.integration/.project new file mode 100644 index 000000000..5faedf3c8 --- /dev/null +++ b/tests/org.simantics.tests.integration/.project @@ -0,0 +1,34 @@ + + + org.simantics.tests.integration + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/tests/org.simantics.tests.integration/META-INF/MANIFEST.MF b/tests/org.simantics.tests.integration/META-INF/MANIFEST.MF new file mode 100644 index 000000000..bfbaa85ae --- /dev/null +++ b/tests/org.simantics.tests.integration/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Simantics Integration STS +Bundle-SymbolicName: org.simantics.tests.integration +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Semantum Oy +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.osgi, + org.junit, + org.simantics.tests.modelled, + org.simantics.modeling, + org.simantics.db.testing, + org.slf4j.api, + org.simantics.application, + org.simantics.scl.osgi diff --git a/tests/org.simantics.tests.integration/SimanticsIntegrationTests.pgraph b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.pgraph new file mode 100644 index 000000000..ad930e8e0 --- /dev/null +++ b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.pgraph @@ -0,0 +1,17 @@ +L0 = +PlatformUI = +Tests = + +BASE = : PlatformUI.SharedOntology + @L0.new +BASE.Layer0 : Tests.STSSuite +BASE.Layer0.Layer0Exists : Tests.STSTest + Tests.STSTest.definition "70a8e455d4fa52f3e0ea81767b99a7506cfd2a712ef165686513fed02be148a2" // "> uriOf (resource \"http://www.simantics.org/Layer0-1.1\")\r\n\"http://www.simantics.org/Layer0-1.1.. +BASE.Layer0.Layer0Exists.SCLModule : L0.SCLModule + L0.SCLModule.definition "" +BASE.Layer0.NameTests : Tests.STSTest + Tests.STSTest.definition "> nameOf layer0\r\n\"Layer0-1.1\"" +BASE.Layer0.SCL : L0.SCLModule + L0.SCLModule.definition "31c1a9551e06151fb93142e5e1d2756e56ebfb6f5f8799b22e2eb95c170c9bd9" // "include \"./../SCLMain\"\r\ninclude \"http://www.simantics.org/Layer0-1.1\" as L0\r\n\r\nlayer0 :: .. +BASE.SCLMain : L0.SCLModule + L0.SCLModule.definition "include \"Simantics/DB\"" diff --git a/tests/org.simantics.tests.integration/SimanticsIntegrationTests.sharedLibrary b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.sharedLibrary new file mode 100644 index 000000000..8d46525a8 Binary files /dev/null and b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.sharedLibrary differ diff --git a/tests/org.simantics.tests.integration/SimanticsIntegrationTests.tg b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.tg new file mode 100644 index 000000000..b4d9a2b3e Binary files /dev/null and b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.tg differ diff --git a/tests/org.simantics.tests.integration/build.properties b/tests/org.simantics.tests.integration/build.properties new file mode 100644 index 000000000..aaa80a7fa --- /dev/null +++ b/tests/org.simantics.tests.integration/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + SimanticsIntegrationTests.tg diff --git a/tests/org.simantics.tests.integration/pom.xml b/tests/org.simantics.tests.integration/pom.xml new file mode 100644 index 000000000..6941bf86e --- /dev/null +++ b/tests/org.simantics.tests.integration/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + + org.simantics + org.simantics.root.tests + 1.0.0-SNAPSHOT + + + org.simantics.tests.integration + 1.0.0-SNAPSHOT + eclipse-test-plugin + + + + + org.eclipse.tycho + target-platform-configuration + + + + org.simantics + org.simantics.sdk.build.targetdefinition + 1.0.0-SNAPSHOT + + + + + + eclipse-feature + org.simantics.sdk + 0.0.0 + + + eclipse-feature + org.simantics.tests.modelled.feature + 0.0.0 + + + eclipse-feature + org.simantics.modeling + 0.0.0 + + + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + org.eclipse.pde.junit.runtime.coretestapplication + org.simantics.tests.integration.SimanticsIntegrationTestSuite + once + -Xms2512m -Xmx2512m + + + + + + \ No newline at end of file diff --git a/tests/org.simantics.tests.integration/src/org/simantics/tests/integration/RuntimeSTSSuite.java b/tests/org.simantics.tests.integration/src/org/simantics/tests/integration/RuntimeSTSSuite.java new file mode 100644 index 000000000..f7c342a5d --- /dev/null +++ b/tests/org.simantics.tests.integration/src/org/simantics/tests/integration/RuntimeSTSSuite.java @@ -0,0 +1,8 @@ +package org.simantics.tests.integration; + +import org.junit.runner.RunWith; +import org.simantics.tests.modelled.junit.v2.ModelledSTSRunner; + +@RunWith(ModelledSTSRunner.class) +public class RuntimeSTSSuite { +} \ No newline at end of file diff --git a/tests/org.simantics.tests.integration/src/org/simantics/tests/integration/SimanticsIntegrationTestSuite.java b/tests/org.simantics.tests.integration/src/org/simantics/tests/integration/SimanticsIntegrationTestSuite.java new file mode 100644 index 000000000..766b9fc8b --- /dev/null +++ b/tests/org.simantics.tests.integration/src/org/simantics/tests/integration/SimanticsIntegrationTestSuite.java @@ -0,0 +1,11 @@ +package org.simantics.tests.integration; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + RuntimeSTSSuite.class +}) +public class SimanticsIntegrationTestSuite { +} \ No newline at end of file diff --git a/tests/pom.xml b/tests/pom.xml index c5093e853..b51195ff7 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -29,5 +29,6 @@ org.simantics.scl.compiler.tests org.simantics.scl.osgi.tests + org.simantics.tests.integration