Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-04-08 18:53:13 -0400
committeratikhomirov2010-04-08 18:53:13 -0400
commit18a9d0aa57c7c1a9c618266d1d8e41687674e307 (patch)
treeae1a4ada328a7ee1c2a87b1d685aecfd336b4bc9
parent65dedddf02a46553fce334e7462f510e2fe145cd (diff)
downloadorg.eclipse.gmf-tooling-18a9d0aa57c7c1a9c618266d1d8e41687674e307.tar.gz
org.eclipse.gmf-tooling-18a9d0aa57c7c1a9c618266d1d8e41687674e307.tar.xz
org.eclipse.gmf-tooling-18a9d0aa57c7c1a9c618266d1d8e41687674e307.zip
approach to shared configuration objects refactored. Configuration is kept in a single place now, and few tests easily share single config object.v20100408-2359
Capacity for other state-like shared objects.
-rw-r--r--tests/org.eclipse.gmf.tests.lite/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/AllTests.java46
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramEditorOutlineTest.java2
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramNodeCloneMoveTest.java2
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/ExternalNodeLabelsTest.java2
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/NotationRefreshTest.java2
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LibraryConstrainedSetup.java4
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteLinksSessionSetup.java2
-rw-r--r--tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteSessionSetup.java4
9 files changed, 36 insertions, 30 deletions
diff --git a/tests/org.eclipse.gmf.tests.lite/META-INF/MANIFEST.MF b/tests/org.eclipse.gmf.tests.lite/META-INF/MANIFEST.MF
index 5513379c7..23c9468f8 100644
--- a/tests/org.eclipse.gmf.tests.lite/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.gmf.tests.lite/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.gmf.tests.lite
-Bundle-Version: 2.0.100.qualifier
+Bundle-Version: 2.0.200.qualifier
Bundle-Activator: org.eclipse.gmf.tests.lite.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/AllTests.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/AllTests.java
index 1bf504853..9ad64092b 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/AllTests.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/AllTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2009 Borland Software Corporation and others
+ * Copyright (c) 2006, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -12,11 +12,10 @@
package org.eclipse.gmf.tests.lite;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.gmf.tests.CleanupTest;
-import org.eclipse.gmf.tests.TestConfiguration;
+import org.eclipse.gmf.tests.Plugin;
import org.eclipse.gmf.tests.lite.gef.DiagramEditorMatchingStrategyTest;
import org.eclipse.gmf.tests.lite.gef.DiagramEditorOutlineTest;
import org.eclipse.gmf.tests.lite.gef.DiagramElementDeleteTest;
@@ -51,19 +50,32 @@ public class AllTests {
final MultiSetup multiSetup = new MultiSetup(sessionSetup2, sessionSetup3);
SessionSetup.disallowSingleTestCaseUse();
+
+ Plugin.getConfig().register(DiagramEditorMatchingStrategyTest.class, sessionSetup3);
+ Plugin.getConfig().register(DiagramEditorOutlineTest.class, sessionSetup3); // myDefaultSetup = LibraryConstrainedSetup.getInstance();
+ Plugin.getConfig().register(DiagramElementDeleteTest.class, sessionSetup3);
+ Plugin.getConfig().register(ExternalNodeLabelsTest.class, sessionSetup3); // myDefaultSetup = ...
+ Plugin.getConfig().register(DiagramNodeTest.class, sessionSetup);
+ Plugin.getConfig().register(DiagramNodeCloneMoveTest.class, sessionSetup3); // myDefaultSetup = ...
+ Plugin.getConfig().register(DiagramElementTest.class, sessionSetup2);
+ Plugin.getConfig().register(DiagramLinksTest.class, sessionSetup2);
+ Plugin.getConfig().register(ElementInitializerTest.class, sessionSetup2);
+ Plugin.getConfig().register(LinkCreationConstraintsTest.class, sessionSetup2);
+ Plugin.getConfig().register(NotationRefreshTest.class, sessionSetup3); // myDefaultSetup = LibraryConstrainedSetup.getInstance();
+ Plugin.getConfig().register(ShortcutCreationTest.class, multiSetup);
- suite.addTest(feed(DiagramEditorMatchingStrategyTest.class, sessionSetup3));
- suite.addTest(feed(DiagramEditorOutlineTest.class, sessionSetup3));
- suite.addTest(feed(DiagramElementDeleteTest.class, sessionSetup3));
- suite.addTest(feed(ExternalNodeLabelsTest.class, sessionSetup3));
- suite.addTest(feed(DiagramNodeTest.class, sessionSetup));
- suite.addTest(feed(DiagramNodeCloneMoveTest.class, sessionSetup3));
- suite.addTest(feed(DiagramElementTest.class, sessionSetup2));
- suite.addTest(feed(DiagramLinksTest.class, sessionSetup2));
- suite.addTest(feed(ElementInitializerTest.class, sessionSetup2));
- suite.addTest(feed(LinkCreationConstraintsTest.class, sessionSetup2));
- suite.addTest(feed(NotationRefreshTest.class, sessionSetup3));
- suite.addTest(feed(ShortcutCreationTest.class, multiSetup));
+ suite.addTestSuite(DiagramEditorMatchingStrategyTest.class);
+ suite.addTestSuite(DiagramEditorOutlineTest.class);
+ suite.addTestSuite(DiagramElementDeleteTest.class);
+ suite.addTestSuite(ExternalNodeLabelsTest.class);
+ suite.addTestSuite(DiagramNodeTest.class);
+ suite.addTestSuite(DiagramNodeCloneMoveTest.class);
+ suite.addTestSuite(DiagramElementTest.class);
+ suite.addTestSuite(DiagramLinksTest.class);
+ suite.addTestSuite(ElementInitializerTest.class);
+ suite.addTestSuite(LinkCreationConstraintsTest.class);
+ suite.addTestSuite(NotationRefreshTest.class);
+ suite.addTestSuite(ShortcutCreationTest.class);
suite.addTestSuite(SVGFigureTest.class);
suite.addTestSuite(GeneratedSVGFigureTest.class);
suite.addTest(new CleanupTest("testCleanup") {
@@ -75,8 +87,4 @@ public class AllTests {
});
return suite;
}
-
- private static Test feed(Class<? extends TestCase> theClass, TestConfiguration config) {
- return org.eclipse.gmf.tests.AllTests.feed(theClass, config);
- }
}
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramEditorOutlineTest.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramEditorOutlineTest.java
index 52946d2c7..e0bfa1d60 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramEditorOutlineTest.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramEditorOutlineTest.java
@@ -22,7 +22,6 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.tests.gef.AbstractDiagramEditorTest;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
-import org.eclipse.gmf.tests.lite.setup.LibraryConstrainedSetup;
import org.eclipse.gmf.tests.setup.GeneratedDiagramPlugin;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IViewPart;
@@ -35,7 +34,6 @@ public class DiagramEditorOutlineTest extends AbstractDiagramEditorTest {
public DiagramEditorOutlineTest(String name) {
super(name, new LiteGeneratorConfiguration());
- myDefaultSetup = LibraryConstrainedSetup.getInstance();
}
@Override
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramNodeCloneMoveTest.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramNodeCloneMoveTest.java
index f4fb2388e..57fed990f 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramNodeCloneMoveTest.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/DiagramNodeCloneMoveTest.java
@@ -46,13 +46,11 @@ import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
-import org.eclipse.gmf.tests.lite.setup.LibraryConstrainedSetup;
import org.eclipse.gmf.tests.rt.GeneratedCanvasTest;
public class DiagramNodeCloneMoveTest extends GeneratedCanvasTest {
public DiagramNodeCloneMoveTest(String name) {
super(name, new LiteGeneratorConfiguration());
- myDefaultSetup = LibraryConstrainedSetup.getInstance();
}
public void testClone() throws Exception {
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/ExternalNodeLabelsTest.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/ExternalNodeLabelsTest.java
index b00920a15..03dff2708 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/ExternalNodeLabelsTest.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/ExternalNodeLabelsTest.java
@@ -37,7 +37,6 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tests.gef.AbstractDiagramEditorTest;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
-import org.eclipse.gmf.tests.lite.setup.LibraryConstrainedSetup;
import org.eclipse.gmf.tests.setup.GeneratedDiagramPlugin;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
@@ -50,7 +49,6 @@ public class ExternalNodeLabelsTest extends AbstractDiagramEditorTest {
public ExternalNodeLabelsTest(String name) {
super(name, new LiteGeneratorConfiguration());
PlatformUI.getWorkbench().getEditorRegistry();
- myDefaultSetup = LibraryConstrainedSetup.getInstance();
}
public void testExternalNodeLabelsPosition() throws Exception {
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/NotationRefreshTest.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/NotationRefreshTest.java
index 5c29b83ca..891580850 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/NotationRefreshTest.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gef/NotationRefreshTest.java
@@ -37,13 +37,11 @@ import org.eclipse.gmf.runtime.notation.NotationFactory;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
-import org.eclipse.gmf.tests.lite.setup.LibraryConstrainedSetup;
import org.eclipse.gmf.tests.rt.GeneratedCanvasTest;
public class NotationRefreshTest extends GeneratedCanvasTest {
public NotationRefreshTest(String name) {
super(name, new LiteGeneratorConfiguration());
- myDefaultSetup = LibraryConstrainedSetup.getInstance();
}
public void testNotationRefreshOnDeleteNode() throws Exception {
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LibraryConstrainedSetup.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LibraryConstrainedSetup.java
index eee7480fe..a15c0536e 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LibraryConstrainedSetup.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LibraryConstrainedSetup.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2008 Borland Software Corporation
+ * Copyright (c) 2006, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -19,6 +19,7 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.gmf.tests.EPath;
+import org.eclipse.gmf.tests.TestConfiguration;
import org.eclipse.gmf.tests.lite.Activator;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
import org.eclipse.gmf.tests.setup.DiaGenFileSetup;
@@ -39,6 +40,7 @@ public class LibraryConstrainedSetup extends SessionSetup {
super(genConfig);
}
+ @TestConfiguration.FactoryMethod
public static LibraryConstrainedSetup getInstance() {
if (factoryClosed) {
return null;
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteLinksSessionSetup.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteLinksSessionSetup.java
index 8df339b9c..45ee0be8a 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteLinksSessionSetup.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteLinksSessionSetup.java
@@ -11,6 +11,7 @@
*/
package org.eclipse.gmf.tests.lite.setup;
+import org.eclipse.gmf.tests.TestConfiguration;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
import org.eclipse.gmf.tests.setup.DiaGenSource;
import org.eclipse.gmf.tests.setup.GeneratorConfiguration;
@@ -23,6 +24,7 @@ public class LiteLinksSessionSetup extends LinksSessionSetup {
super(genConfig);
}
+ @TestConfiguration.FactoryMethod
public static LinksSessionSetup getInstance() {
if (factoryClosed) {
return null;
diff --git a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteSessionSetup.java b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteSessionSetup.java
index 53426499f..0cdfd7b86 100644
--- a/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteSessionSetup.java
+++ b/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/setup/LiteSessionSetup.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2008 Borland Software Corporation
+ * Copyright (c) 2006, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -19,6 +19,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenRGBColor;
import org.eclipse.gmf.graphdef.codegen.MapModeCodeGenStrategy;
import org.eclipse.gmf.internal.bridge.genmodel.InnerClassViewmapProducer;
import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.tests.TestConfiguration;
import org.eclipse.gmf.tests.lite.gen.LiteGeneratorConfiguration;
import org.eclipse.gmf.tests.setup.DiaGenSetup;
import org.eclipse.gmf.tests.setup.DiaGenSource;
@@ -32,6 +33,7 @@ public class LiteSessionSetup extends SessionSetup {
super(genConfig);
}
+ @TestConfiguration.FactoryMethod
public static SessionSetup getInstance() {
if (factoryClosed) {
return null;

Back to the top