Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-10-21 16:45:37 -0400
committerGerrit Code Review @ Eclipse.org2016-10-21 19:12:49 -0400
commit8dfadbbce8eb3c3d17320478b12015a0641ff367 (patch)
treef723dbcdcaa7fc427c0000e40d337119ede2dda4
parentd6dcb6909b24297c2ff0b11c127f2f557b73c683 (diff)
downloadorg.eclipse.mylyn-8dfadbbce8eb3c3d17320478b12015a0641ff367.tar.gz
org.eclipse.mylyn-8dfadbbce8eb3c3d17320478b12015a0641ff367.tar.xz
org.eclipse.mylyn-8dfadbbce8eb3c3d17320478b12015a0641ff367.zip
503109: create ManagedSuite for junit4
Change-Id: Ie3be756a125102931e88958cd026a37dacd34113 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=503109 Signed-off-by: Frank Becker <eclipse@frank-becker.de>
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorHeartbeatTests.java20
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorTests.java33
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllHeartbeatTests.java9
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllLocalTests.java17
-rw-r--r--org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllTests.java17
5 files changed, 49 insertions, 47 deletions
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorHeartbeatTests.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorHeartbeatTests.java
index 8ad93be..3e196dc 100644
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorHeartbeatTests.java
+++ b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorHeartbeatTests.java
@@ -11,12 +11,13 @@
package org.eclipse.mylyn.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
-import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
+
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.Test;
+import junit.framework.TestSuite;
/**
* @author Steffen Pingel
@@ -24,11 +25,16 @@ import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
public class AllConnectorHeartbeatTests {
public static Test suite() {
- TestConfiguration configuration = new TestConfiguration(TestKind.INTEGRATION);
- configuration.setDefaultOnly(true);
+
+ TestConfiguration configuration = ManagedSuite.getTestConfiguration();
+ if (configuration == null) {
+ configuration = new TestConfiguration();
+ configuration.setDefaultOnly(true);
+ ManagedSuite.setTestConfiguration(configuration);
+ }
TestSuite suite = new ManagedTestSuite(AllConnectorHeartbeatTests.class.getName());
- AllConnectorTests.addTests(suite, configuration);
+ suite.addTest(new JUnit4TestAdapter(AllConnectorTests.class));
return suite;
}
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorTests.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorTests.java
index 6b19e40..22897ba 100644
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorTests.java
+++ b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllConnectorTests.java
@@ -13,39 +13,26 @@ package org.eclipse.mylyn.tests;
import org.eclipse.mylyn.bugzilla.rest.core.tests.AllBugzillaRestCoreTests;
import org.eclipse.mylyn.bugzilla.tests.AllBugzillaTests;
-import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
-import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
-import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite;
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite.TestConfigurationProperty;
import org.eclipse.mylyn.gerrit.tests.AllGerritTests;
import org.eclipse.mylyn.hudson.tests.AllHudsonTests;
import org.eclipse.mylyn.tests.util.TestFixture;
import org.eclipse.mylyn.trac.tests.AllTracTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
* @author Shawn Minto
* @author Steffen Pingel
+ * @author Frank Becker
*/
+@RunWith(ManagedSuite.class)
+@Suite.SuiteClasses({ AllBugzillaRestCoreTests.class, AllBugzillaTests.class, AllHudsonTests.class,
+ AllGerritTests.class, AllTracTests.class })
+@TestConfigurationProperty()
public class AllConnectorTests {
-
- public static Test suite() {
+ static {
TestFixture.initializeTasksSettings();
-
- TestConfiguration configuration = new TestConfiguration(TestKind.INTEGRATION);
-
- TestSuite suite = new ManagedTestSuite(AllConnectorTests.class.getName());
- addTests(suite, configuration);
- return suite;
}
-
- static void addTests(TestSuite suite, TestConfiguration configuration) {
- suite.addTest(AllBugzillaTests.suite(configuration));
- suite.addTest(AllTracTests.suite(configuration));
- suite.addTest(AllHudsonTests.suite(configuration));
- suite.addTest(AllGerritTests.suite(configuration));
- suite.addTest(AllBugzillaRestCoreTests.suite(configuration));
- }
-
}
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllHeartbeatTests.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllHeartbeatTests.java
index 16239f1..6548ac2 100644
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllHeartbeatTests.java
+++ b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllHeartbeatTests.java
@@ -11,12 +11,11 @@
package org.eclipse.mylyn.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
-import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
/**
* @author Steffen Pingel
@@ -24,7 +23,7 @@ import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
public class AllHeartbeatTests {
public static Test suite() {
- TestConfiguration configuration = new TestConfiguration(TestKind.INTEGRATION);
+ TestConfiguration configuration = new TestConfiguration();
configuration.setLocalOnly(true);
TestSuite suite = new ManagedTestSuite(AllHeartbeatTests.class.getName());
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllLocalTests.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllLocalTests.java
index f7cf784..1a3d8c6 100644
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllLocalTests.java
+++ b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllLocalTests.java
@@ -13,13 +13,14 @@ package org.eclipse.mylyn.tests;
import org.eclipse.mylyn.bugzilla.rest.core.tests.AllBugzillaRestCoreTests;
import org.eclipse.mylyn.bugzilla.tests.AllBugzillaTests;
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
-import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
import org.eclipse.mylyn.gerrit.tests.AllGerritTests;
import org.eclipse.mylyn.hudson.tests.AllHudsonTests;
import org.eclipse.mylyn.trac.tests.AllTracTests;
+import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -29,12 +30,16 @@ import junit.framework.TestSuite;
public class AllLocalTests {
public static Test suite() {
- TestConfiguration configuration = new TestConfiguration(TestKind.INTEGRATION);
- configuration.setLocalOnly(true);
+ TestConfiguration testConfiguration = ManagedSuite.getTestConfiguration();
+ if (testConfiguration == null) {
+ TestConfiguration configuration = new TestConfiguration();
+ configuration.setLocalOnly(true);
+ ManagedSuite.setTestConfiguration(configuration);
+ }
TestSuite suite = new ManagedTestSuite(AllLocalTests.class.getName());
- AllNonConnectorTests.addTests(suite, configuration);
- addTests(suite, configuration);
+ AllNonConnectorTests.addTests(suite, testConfiguration);
+ addTests(suite, testConfiguration);
return suite;
}
@@ -43,7 +48,7 @@ public class AllLocalTests {
suite.addTest(AllTracTests.suite(configuration));
suite.addTest(AllHudsonTests.suite(configuration));
suite.addTest(AllGerritTests.suite(configuration));
- suite.addTest(AllBugzillaRestCoreTests.suite(configuration));
+ suite.addTest(new JUnit4TestAdapter(AllBugzillaRestCoreTests.class));
}
}
diff --git a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllTests.java b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllTests.java
index f3aa180..a67face 100644
--- a/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllTests.java
+++ b/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/AllTests.java
@@ -11,12 +11,13 @@
package org.eclipse.mylyn.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
-import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
+
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.Test;
+import junit.framework.TestSuite;
/**
* @author Mik Kersten
@@ -24,11 +25,15 @@ import org.eclipse.mylyn.commons.sdk.util.TestConfiguration.TestKind;
public class AllTests {
public static Test suite() {
- TestConfiguration configuration = new TestConfiguration(TestKind.INTEGRATION);
+ TestConfiguration configuration = ManagedSuite.getTestConfiguration();
+ if (configuration == null) {
+ configuration = new TestConfiguration();
+ ManagedSuite.setTestConfiguration(configuration);
+ }
TestSuite suite = new ManagedTestSuite(AllTests.class.getName());
AllNonConnectorTests.addTests(suite, configuration);
- AllConnectorTests.addTests(suite, configuration);
+ suite.addTest(new JUnit4TestAdapter(AllConnectorTests.class));
return suite;
}

Back to the top