X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.tests%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftests%2Fcommands%2FAssertMappedComponent.java;fp=bundles%2Forg.simantics.modeling.tests%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftests%2Fcommands%2FAssertMappedComponent.java;h=a17c2b30fc35dff8e32c3af110e8493c0892ece2;hb=ca6fcd858a0b82eb1b5a8f12c4d5df30e84393e0;hp=0000000000000000000000000000000000000000;hpb=67fd62f9c742337ec80eef658192db198a0efaac;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/AssertMappedComponent.java b/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/AssertMappedComponent.java new file mode 100644 index 000000000..a17c2b30f --- /dev/null +++ b/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/AssertMappedComponent.java @@ -0,0 +1,30 @@ +package org.simantics.modeling.tests.commands; + +import junit.framework.Assert; + +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.testing.common.WriteCommand; +import org.simantics.modeling.ModelingResources; +import org.simantics.modeling.tests.cases.ModelingCommandSequenceTest; + + +public class AssertMappedComponent extends WriteCommand { + + private AddModule module; + + public AssertMappedComponent(AddModule module) { + this.module = module; + } + + @Override + protected void run(WriteGraph graph, ModelingCommandSequenceTest environment) throws DatabaseException { + + Resource element = module.getResource(); + Resource component = graph.getPossibleObject(element, ModelingResources.getInstance(graph).ElementToComponent); + Assert.assertNotNull(component); + + } + +} \ No newline at end of file