Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoratikhomirov2006-01-11 14:31:46 +0000
committeratikhomirov2006-01-11 14:31:46 +0000
commit3ad4869e7b40ba7e76484b3e287156b36904cdfd (patch)
treec5c18da4f92014958f97d1c697d81280045c6dea /tests
parentee29f51ed574b0767f9cbee1490d001197b5bb13 (diff)
downloadorg.eclipse.gmf-tooling-3ad4869e7b40ba7e76484b3e287156b36904cdfd.tar.gz
org.eclipse.gmf-tooling-3ad4869e7b40ba7e76484b3e287156b36904cdfd.tar.xz
org.eclipse.gmf-tooling-3ad4869e7b40ba7e76484b3e287156b36904cdfd.zip
share mapping model through sessionSetup
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/SessionSetup.java24
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/AbstractMappingTransformerTest.java10
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/GenModelTransformerTest.java5
3 files changed, 31 insertions, 8 deletions
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/SessionSetup.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/SessionSetup.java
index 636bc1282..6ebcc1c79 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/SessionSetup.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/SessionSetup.java
@@ -22,6 +22,8 @@ public class SessionSetup implements TestConfiguration {
private DomainModelSource myDomainModel;
private DiaGenSource myGenModel;
private GenProjectSetup myProject;
+ private MapDefSource myMapModel;
+ private DiaDefSource myGraphDefModel;
private int myUses;
private static RuntimeWorkspaceSetup myRuntimeWorkspaceSetup;
protected static boolean factoryClosed = false;
@@ -82,6 +84,28 @@ public class SessionSetup implements TestConfiguration {
return new GenProjectSetup().init(getRuntimeWorkspaceSetup(), getGenModel());
}
+ public MapDefSource getMapModel() {
+ if (myMapModel == null) {
+ myMapModel = createMapModel();
+ }
+ return myMapModel;
+ }
+
+ protected MapDefSource createMapModel() {
+ return new MapSetup().init(getGraphDefModel(), getDomainModel(), new ToolDefSetup());
+ }
+
+ public DiaDefSource getGraphDefModel() {
+ if (myGraphDefModel == null) {
+ myGraphDefModel = createGraphDefModel();
+ }
+ return myGraphDefModel;
+ }
+
+ protected DiaDefSource createGraphDefModel() {
+ return new DiaDefSetup(null);
+ }
+
public static RuntimeWorkspaceSetup getRuntimeWorkspaceSetup() throws Exception {
if (myRuntimeWorkspaceSetup == null) {
myRuntimeWorkspaceSetup = new RuntimeWorkspaceSetup();
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/AbstractMappingTransformerTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/AbstractMappingTransformerTest.java
index ecb0d7a9e..8df93ef48 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/AbstractMappingTransformerTest.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/AbstractMappingTransformerTest.java
@@ -20,11 +20,13 @@ import org.eclipse.gmf.mappings.Mapping;
import org.eclipse.gmf.mappings.NodeMapping;
import org.eclipse.gmf.tests.ConfiguredTestCase;
import org.eclipse.gmf.tests.setup.DiaDefSetup;
+import org.eclipse.gmf.tests.setup.DiaDefSource;
+import org.eclipse.gmf.tests.setup.MapDefSource;
import org.eclipse.gmf.tests.setup.MapSetup;
import org.eclipse.gmf.tests.setup.ToolDefSetup;
public abstract class AbstractMappingTransformerTest extends ConfiguredTestCase implements DiaDefSetup.Config {
- private MapSetup myMapDef;
+ private MapDefSource myMapDef;
private DiaDefSetup myDiaDef;
protected AbstractMappingTransformerTest(String name) {
@@ -35,8 +37,10 @@ public abstract class AbstractMappingTransformerTest extends ConfiguredTestCase
super.setUp();
myDiaDef = new DiaDefSetup(this);
myDiaDef.init();
- myMapDef = new MapSetup();
- myMapDef.init(myDiaDef, getSetup().getDomainModel(), new ToolDefSetup());
+ myMapDef = initMapModel(myDiaDef);
+ }
+ protected MapDefSource initMapModel(DiaDefSource graphDef) {
+ return new MapSetup().init(graphDef, getSetup().getDomainModel(), new ToolDefSetup());
}
protected final Canvas getCanvasDef() {
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/GenModelTransformerTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/GenModelTransformerTest.java
index a7d246f9b..ef9a53ef8 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/GenModelTransformerTest.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/GenModelTransformerTest.java
@@ -39,11 +39,6 @@ public abstract class GenModelTransformerTest extends AbstractMappingTransformer
super(name);
}
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- }
-
public void testGenModelTransform() {
final DiagramRunTimeModelHelper drtModelHelper = getRTHelper();
final Mapping m = getMapping();

Back to the top