1 package org.simantics.modeling.tests.cases;
3 import org.simantics.db.testing.base.CommandList;
4 import org.simantics.db.testing.base.CommandListImpl;
5 import org.simantics.db.testing.base.CommandSequenceTest;
6 import org.simantics.db.testing.common.Command;
7 import org.simantics.db.testing.common.CommandSequenceEnvironment;
8 import org.simantics.diagram.stubs.DiagramResource;
9 import org.simantics.modeling.tests.commands.CollectMemory;
10 import org.simantics.modeling.tests.commands.WaitActiveExperiment;
11 import org.simantics.modeling.tests.commands.WaitMapping;
12 import org.simantics.modeling.tests.commands.WriteHeapDump;
14 public class ModelingCommandSequenceTest extends CommandSequenceTest {
16 protected WaitActiveExperiment waitExperiment = new WaitActiveExperiment();
17 protected WaitMapping waitMapping = new WaitMapping();
18 protected CollectMemory collectMemory = new CollectMemory();
19 protected WriteHeapDump heapDump = new WriteHeapDump(getClass().getSimpleName()+ ".hprof");
21 protected DiagramResource DIA;
24 protected void initialize(CommandSequenceEnvironment environment) throws Exception {
26 DIA = DiagramResource.getInstance(environment.getSession());
30 protected void createBeforeSequence(CommandList result) throws Exception {
33 protected void createAfterSequence(CommandList result) throws Exception {
36 protected void createSequence(CommandList result) throws Exception {
40 protected Command[] beforeSequence(CommandSequenceEnvironment environment) throws Exception {
41 CommandListImpl result = new CommandListImpl();
42 createBeforeSequence(result);
43 return result.toArray();
48 protected Command[] newSequence() throws Exception {
49 CommandListImpl result = new CommandListImpl();
50 createSequence(result);
51 return result.toArray();
56 protected Command[] afterSequence(CommandSequenceEnvironment environment) throws Exception {
57 CommandListImpl result = new CommandListImpl();
58 createAfterSequence(result);
59 return result.toArray();