X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.tests%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftests%2Fcases%2FModelingCommandSequenceTest.java;fp=bundles%2Forg.simantics.modeling.tests%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftests%2Fcases%2FModelingCommandSequenceTest.java;h=7b86380183c7fbf2a231c17547dac3195171c52e;hb=ca6fcd858a0b82eb1b5a8f12c4d5df30e84393e0;hp=0000000000000000000000000000000000000000;hpb=67fd62f9c742337ec80eef658192db198a0efaac;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/cases/ModelingCommandSequenceTest.java b/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/cases/ModelingCommandSequenceTest.java new file mode 100644 index 000000000..7b8638018 --- /dev/null +++ b/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/cases/ModelingCommandSequenceTest.java @@ -0,0 +1,62 @@ +package org.simantics.modeling.tests.cases; + +import org.simantics.db.testing.base.CommandList; +import org.simantics.db.testing.base.CommandListImpl; +import org.simantics.db.testing.base.CommandSequenceTest; +import org.simantics.db.testing.common.Command; +import org.simantics.db.testing.common.CommandSequenceEnvironment; +import org.simantics.diagram.stubs.DiagramResource; +import org.simantics.modeling.tests.commands.CollectMemory; +import org.simantics.modeling.tests.commands.WaitActiveExperiment; +import org.simantics.modeling.tests.commands.WaitMapping; +import org.simantics.modeling.tests.commands.WriteHeapDump; + +public class ModelingCommandSequenceTest extends CommandSequenceTest { + + protected WaitActiveExperiment waitExperiment = new WaitActiveExperiment(); + protected WaitMapping waitMapping = new WaitMapping(); + protected CollectMemory collectMemory = new CollectMemory(); + protected WriteHeapDump heapDump = new WriteHeapDump(getClass().getSimpleName()+ ".hprof"); + + protected DiagramResource DIA; + + @Override + protected void initialize(CommandSequenceEnvironment environment) throws Exception { + + DIA = DiagramResource.getInstance(environment.getSession()); + + } + + protected void createBeforeSequence(CommandList result) throws Exception { + } + + protected void createAfterSequence(CommandList result) throws Exception { + } + + protected void createSequence(CommandList result) throws Exception { + } + + @Override + protected Command[] beforeSequence(CommandSequenceEnvironment environment) throws Exception { + CommandListImpl result = new CommandListImpl(); + createBeforeSequence(result); + return result.toArray(); + } + + + @Override + protected Command[] newSequence() throws Exception { + CommandListImpl result = new CommandListImpl(); + createSequence(result); + return result.toArray(); + } + + + @Override + protected Command[] afterSequence(CommandSequenceEnvironment environment) throws Exception { + CommandListImpl result = new CommandListImpl(); + createAfterSequence(result); + return result.toArray(); + } + +}