diff options
author | Frank Becker | 2016-10-21 20:45:37 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-10-21 23:12:49 +0000 |
commit | 8dfadbbce8eb3c3d17320478b12015a0641ff367 (patch) | |
tree | f723dbcdcaa7fc427c0000e40d337119ede2dda4 | |
parent | d6dcb6909b24297c2ff0b11c127f2f557b73c683 (diff) | |
download | org.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>
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 8ad93be0..3e196dc4 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 6b19e409..22897bad 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 16239f16..6548ac21 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 f7cf7841..1a3d8c61 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 f3aa1804..a67face1 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; } |