Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-10-14 02:40:41 -0400
committerGerrit Code Review @ Eclipse.org2016-10-21 12:56:27 -0400
commit3630c390facf5251fbc3fc4e7c2b17bae70a402a (patch)
tree2cc6606c6e78889b5cc9d1402819150a67e7192a /connector-bugzilla-rest
parent6acaf16af156b3fea92e8e0c4523ae6e3e1cc3ef (diff)
downloadorg.eclipse.mylyn.tasks-3630c390facf5251fbc3fc4e7c2b17bae70a402a.tar.gz
org.eclipse.mylyn.tasks-3630c390facf5251fbc3fc4e7c2b17bae70a402a.tar.xz
org.eclipse.mylyn.tasks-3630c390facf5251fbc3fc4e7c2b17bae70a402a.zip
503109: create ManagedSuite for junit4
Change-Id: I439c781fdce1524b69450360b8d67878507cf3ef Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=503109
Diffstat (limited to 'connector-bugzilla-rest')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/bugzilla/rest/core/tests/AllBugzillaRestCoreTests.java43
1 files changed, 17 insertions, 26 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/bugzilla/rest/core/tests/AllBugzillaRestCoreTests.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/bugzilla/rest/core/tests/AllBugzillaRestCoreTests.java
index 0bcfc8119..6f829bfc0 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/bugzilla/rest/core/tests/AllBugzillaRestCoreTests.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/bugzilla/rest/core/tests/AllBugzillaRestCoreTests.java
@@ -11,41 +11,32 @@
package org.eclipse.mylyn.bugzilla.rest.core.tests;
+import java.util.List;
+
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
-import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite;
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite.SuiteClassProvider;
+import org.eclipse.mylyn.commons.sdk.util.ManagedSuite.TestConfigurationProperty;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
+@RunWith(ManagedSuite.class)
+@Suite.SuiteClasses({ RepositoryKeyTest.class })
+@TestConfigurationProperty()
public class AllBugzillaRestCoreTests {
- public static Test suite() {
+ static {
if (CommonTestUtil.fixProxyConfiguration()) {
CommonTestUtil.dumpSystemInfo(System.err);
}
-
- TestSuite suite = new ManagedTestSuite(AllBugzillaRestCoreTests.class.getName());
- addTests(suite, TestConfiguration.getDefault());
- return suite;
}
- public static Test suite(TestConfiguration configuration) {
- TestSuite suite = new TestSuite(AllBugzillaRestCoreTests.class.getName());
- addTests(suite, configuration);
- return suite;
- }
-
- public static void addTests(TestSuite suite, TestConfiguration configuration) {
- // Tests that only need to run once (i.e. no network io so doesn't matter which repository)
- suite.addTest(new JUnit4TestAdapter(RepositoryKeyTest.class));
-
- // network tests
- if (!configuration.isLocalOnly()) {
- suite.addTest(new JUnit4TestAdapter(BugzillaRestClientTest.class));
- suite.addTest(new JUnit4TestAdapter(BugzillaRestConfigurationTest.class));
- suite.addTest(new JUnit4TestAdapter(BugzillaRestConnectorTest.class));
+ @SuiteClassProvider
+ public static void add2SuiteClasses(List<Class<?>> suiteClassList, TestConfiguration testConfiguration) {
+ if (!testConfiguration.isLocalOnly()) {
+ suiteClassList.add(BugzillaRestClientTest.class);
+ suiteClassList.add(BugzillaRestConfigurationTest.class);
+ suiteClassList.add(BugzillaRestConnectorTest.class);
}
}
-
}

Back to the top