From 013df68afa182f2c8d0b8a662437e3bcb889d61d Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Thu, 20 Feb 2020 11:20:46 +0200 Subject: [PATCH] Simantics integration STS gitlab #472 Change-Id: Ic65e158b277f7a1a9b4ce788f95f4dec5ab89ac4 --- .../graph/Tests.pgraph | 11 +- .../graph/TestsUI.pgraph | 14 +- .../tests/modelled/ui/STSSuiteSorterRule.java | 121 +++++++++--------- .../scl/Simantics/Tests.scl | 1 + .../tests/modelled/TestsGraphUtils.java | 42 ++++-- .../tests/modelled/utils/ModelledSTSTest.java | 38 ++++-- .../modelled/utils/STSSuiteTestCollector.java | 34 ++++- .../.classpath | 9 ++ .../org.simantics.tests.integration/.project | 34 +++++ .../META-INF/MANIFEST.MF | 15 +++ .../SimanticsIntegrationTests.pgraph | 17 +++ .../SimanticsIntegrationTests.sharedLibrary | Bin 0 -> 2238 bytes .../SimanticsIntegrationTests.tg | Bin 0 -> 2378 bytes .../build.properties | 5 + tests/org.simantics.tests.integration/pom.xml | 64 +++++++++ .../tests/integration/RuntimeSTSSuite.java | 8 ++ .../SimanticsIntegrationTestSuite.java | 11 ++ tests/pom.xml | 1 + 18 files changed, 329 insertions(+), 96 deletions(-) create mode 100644 tests/org.simantics.tests.integration/.classpath create mode 100644 tests/org.simantics.tests.integration/.project create mode 100644 tests/org.simantics.tests.integration/META-INF/MANIFEST.MF create mode 100644 tests/org.simantics.tests.integration/SimanticsIntegrationTests.pgraph create mode 100644 tests/org.simantics.tests.integration/SimanticsIntegrationTests.sharedLibrary create mode 100644 tests/org.simantics.tests.integration/SimanticsIntegrationTests.tg create mode 100644 tests/org.simantics.tests.integration/build.properties create mode 100644 tests/org.simantics.tests.integration/pom.xml create mode 100644 tests/org.simantics.tests.integration/src/org/simantics/tests/integration/RuntimeSTSSuite.java create mode 100644 tests/org.simantics.tests.integration/src/org/simantics/tests/integration/SimanticsIntegrationTestSuite.java 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 0000000000000000000000000000000000000000..8d46525a8f2996693df736ad8e5690b44191ab57 GIT binary patch literal 2238 zcmbtVYj4{&6m=3?wq+}6UftHU9qT^xnC)c11{hngG)}hw?oveQJ`ETci?#*GltEEV z^N02~w{t1cksA!#Faa0hIrrQLAELZu!j%XH;g#a*rc^2|!OClW#YfuLT&Kxv!DSVs zeU{3p3X>W^$8uYzAGJ`DNB#I(MllcW1l5Dwlho&t^Kgf!dJ-#xy<@3$_-hzNS3-@; z0oTItdzX_`B>}(LXK%!nO3^Jl?C!%3yX>IbJN&NK{e~UCWv8c?#da&65=oq@p*V?C zsh6p`E6}b?!dMo%X&O%$2&qFIifo3(Ov^Q!DN7QFQ79peWrITVr(C{>W4#bpmVBB` zqO5Ob*{Eh$Y(eSFuo-!iw^6n88CBsCX)CoenXR=!Zh}n`Qv_uVo7S8UJWBt01{EVS z^G4!**vkLh$i^^A6LjZ`VmnCe{Q1cPu0fQWM}%^0j+E)20$?<@wvvzOc)o-+mna&8 zQlr$GXg%w7I(|6i*t}svD>PP|7VT0bI{ESV+gx&eecev1tR1Uy=Uv40C|1+=XI~$* zyB*(r4(C$GQ9P#a!J~@J^*e!JSIOnAE@l9=M*QmPomBUXzHVBgVo;B2$Z5*T#g>9QeRV1SHAnqGY!%t^I(WyHh zf&9#nI6)JkLY;v5JY)Ltl!wx2zA#MvXP#svL=Q3%r~$tc5tuKDc~Cu*AB0M%{zD_F z9w!OPQQ}8LJS-?4&y!qmIi{Geh?`NIj}^BAf6K2 z+8oB%da3*AboM5dLplNApON!vA;)tfHk@}{X*1^+2D>M?5JH?6!@bNjzu?<7_?5v` zECNx8-^qf`BtAho%tX7yZ7t4VkGS1Jb(aovqe|O{MaQ^8M0H_5t3=hB*)cf%NL_(g zG3*K=0ZIncsT*^oD1fMjlSN_p8$sAk{;{m(_yyk2VeTiGK0)HFek;ejc<;gJ?k0`( zujkn2qbrI07Ml(W7{d~2Z2WeP8QxD|PL6GS1(?k0sUO0&pEAZ&qv$7W{q{DoeyT?g zgHb)&8Jd&zZ(>Y66fxB(V#-;>l%t5Lzd9u;-47*hw?MGg{ATL(U$@|KjQ{r|hF|IV zh`q8u7G|%qJJ(I;_Cjdwc<#T_p-|ZrqGp!O=#SF8r*@~^?&N2%<+*eIZ*R&%2aG3d z(Dhu;jm$m8dOi02h2X(Yiq9rT>>~f=&iy~I|29Q5ykr`Fbj0ZIiABmPVd{lG{sI}f B*H!=k literal 0 HcmV?d00001 diff --git a/tests/org.simantics.tests.integration/SimanticsIntegrationTests.tg b/tests/org.simantics.tests.integration/SimanticsIntegrationTests.tg new file mode 100644 index 0000000000000000000000000000000000000000..b4d9a2b3e09d3cec4d8b129d6e18b13a44dbe36a GIT binary patch literal 2378 zcmbtV+iu%N5S49RC`z*9*iPHr$|%jnmrAnxP(WynI<}J;CLl|+DA3d?02 z|3SZ`?|tqs^&i?fL#|9G4^2@53+*{Gb9QETcGXHILd#$fUTC4ON~O{QjmpZA79-;u zVbbJ<6sks~{T9lp4ig8kYPt2}4@PPwqNDgyMX?Az391LVC8^IN=iyb6nn|n~w+@ss z;kz)3E~Fl>48?FFgU&=GlVKdlMFbE2`17xFAdKXI?ej^hlR#YUcrWFJPN@uUueU>E zujlRd`g`B^d*68nuf5~r^I{#9mX=AJ>Y+T0Q)O7$l~jjH!dMm3Y+_9}45Tul31wD# zQEAb!N|{I?N1-CuSTzuuf93L79Ge?)WhJIr5oL2V%Vv(<${U{58J$v|Ra= zf^Wq+QQ09dauYf|Ii;X1VNR|3UPS4?S5RR$uA78+Xe|BD6K)KnG@CLeiq4@P-A5JHJFEmWjEQyJyFy*YM6yR zXRbzJP@;e*OjO?pZCH0L!@ki}E!o!@*Zso*Z9y6#WDC^#&3)Sjw^dmD3yz}(o=6>< zgsk_OsU0MV)J!}8ala7r6?@bvxubY0LhR)orW$@aqaeCaoa2{FI++tQPnmHK>6VAo z1I*pcyhv>zE@VVv_rTmOEZ9J+HShVhop9a8THqYHmwq}Ry91|2H9HNOE&)4Bv?KIe zVo=9sas)9orka`m@dxBXYz1uX#y+~B8Z~TfR_t%UG&XTt=yxT@Pjl>kgmH_&S^xDM zKgs=}1^ZTx@lIn{|Fs-%7xbZN?W;5gw(H{+Dq=3QV5ceDi|ZrC%k^>5fvx^Vj;($r z$2J~oA;$V6U*Jc%9<&f+?WiBv##_6szf3j^>kmC(TR&n^leI$+*yy)@6M)9rM+d26>@?wtRe z3_Ou|gI>#Rxe-5sUcc}Ca3)3YN{iWK-#g3y<>&Svz5iAsCA`21KiK#1hfSN5twg04 GcH$qUCLP-V literal 0 HcmV?d00001 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 -- 2.47.1