X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.tests.modelled%2Fsrc%2Forg%2Fsimantics%2Ftests%2Fmodelled%2FTestsGraphUtils.java;h=c5253bd5a37ad138d159b4b7b938ad3a159cbf6e;hp=e9ce7d06ff24d775992a896969cb71ccb034a0a7;hb=4789a20d317a245e03096df441baba1ab338c1f0;hpb=1cc487c3f6cf4b46b1fdd727183a9483e3bc05bb 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 e9ce7d06f..c5253bd5a 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 @@ -31,9 +31,24 @@ public class TestsGraphUtils { 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();