diff options
author | Steffen Pingel | 2011-07-15 09:54:46 +0000 |
---|---|---|
committer | Steffen Pingel | 2011-07-15 09:56:27 +0000 |
commit | 45e0c789dfa93d2b20065131aaf57a0a93d213d6 (patch) | |
tree | 9eba287e0d76c04e773e673c15d60104e7386e6b | |
parent | 6ac7ac86cf6e7556ff2f3c2a41925877c7bdcc29 (diff) | |
download | org.eclipse.mylyn.tasks-45e0c789dfa93d2b20065131aaf57a0a93d213d6.tar.gz org.eclipse.mylyn.tasks-45e0c789dfa93d2b20065131aaf57a0a93d213d6.tar.xz org.eclipse.mylyn.tasks-45e0c789dfa93d2b20065131aaf57a0a93d213d6.zip |
bug 339956: reduce redundancy in build and simplify target management
https://bugs.eclipse.org/bugs/show_bug.cgi?id=339956
5 files changed, 28 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java index 8e0f3f64a..367e80e92 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java @@ -21,7 +21,9 @@ import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaRepositorySettingsPageTest; import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaSearchPageTest; import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaTaskHyperlinkDetectorTest; import org.eclipse.mylyn.bugzilla.tests.ui.TaskEditorTest; +import org.eclipse.mylyn.commons.tests.support.ManagedTestSuite; import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; +import org.eclipse.mylyn.tests.util.TestUtil; /** * @author Mik Kersten @@ -29,12 +31,18 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; public class AllBugzillaTests { public static Test suite() { - return suite(false); + TestSuite suite = new ManagedTestSuite(AllBugzillaTests.class.getName()); + addTests(TestUtil.runHeartbeatTestsOnly(), suite); + return suite; } public static Test suite(boolean defaultOnly) { - TestSuite suite = new TestSuite("Tests for org.eclipse.mylyn.bugzilla.tests"); + TestSuite suite = new TestSuite(AllBugzillaTests.class.getName()); + addTests(defaultOnly, suite); + return suite; + } + private static void addTests(boolean defaultOnly, TestSuite suite) { // Standalone tests (Don't require an instance of Eclipse) suite.addTest(AllBugzillaHeadlessStandaloneTests.suite(defaultOnly)); @@ -59,8 +67,6 @@ public class AllBugzillaTests { addTests_3_6(suite, fixture); } } - - return suite; } protected static void addTests_3_6(TestSuite suite, BugzillaFixture fixture) { diff --git a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java index 8085dd267..1fa5698bf 100644 --- a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java +++ b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java @@ -129,6 +129,10 @@ public class TestUtil { return CommonTestUtil.getFile(source, filename); } + public static boolean runHeartbeatTestsOnly() { + return !Boolean.parseBoolean(System.getProperty("org.eclipse.mylyn.tests.all")); + } + // public static File getFile(String bundleId, Class<?> clazz, String filename) throws IOException { // Bundle bundle = Platform.getBundle(bundleId); // if (bundle != null) { diff --git a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF index 4ba4684b9..49f61e0c9 100644 --- a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF @@ -11,6 +11,7 @@ Require-Bundle: org.apache.xmlrpc;bundle-version="3.0.0", org.eclipse.ui, org.eclipse.ui.workbench.texteditor, org.eclipse.mylyn.commons.net, + org.eclipse.mylyn.commons.tests, org.eclipse.mylyn.context.core, org.eclipse.mylyn.tasks.ui, org.eclipse.mylyn.tasks.core, diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java index cbc62c78d..646c2e038 100644 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java +++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java @@ -15,6 +15,7 @@ import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version; +import org.eclipse.mylyn.tests.util.TestUtil; import org.eclipse.mylyn.trac.tests.client.TracClientFactoryTest; import org.eclipse.mylyn.trac.tests.client.TracClientProxyTest; import org.eclipse.mylyn.trac.tests.client.TracClientTest; @@ -31,7 +32,7 @@ import org.eclipse.mylyn.trac.tests.support.TracFixture; public class AllTracHeadlessStandaloneTests { public static Test suite() { - return suite(false); + return suite(TestUtil.runHeartbeatTestsOnly()); } public static Test suite(boolean defaultOnly) { diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java index 020d54cd8..157a95e18 100644 --- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java +++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java @@ -14,7 +14,9 @@ package org.eclipse.mylyn.trac.tests; import junit.framework.Test; import junit.framework.TestSuite; +import org.eclipse.mylyn.commons.tests.support.ManagedTestSuite; import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version; +import org.eclipse.mylyn.tests.util.TestUtil; import org.eclipse.mylyn.trac.tests.core.TracAttachmentHandlerTest; import org.eclipse.mylyn.trac.tests.core.TracRepositoryConnectorTest; import org.eclipse.mylyn.trac.tests.core.TracRepositoryConnectorWebTest; @@ -32,11 +34,18 @@ import org.eclipse.mylyn.trac.tests.ui.TracRepositorySettingsPageTest; public class AllTracTests { public static Test suite() { - return suite(false); + TestSuite suite = new ManagedTestSuite(AllTracTests.class.getName()); + addTests(TestUtil.runHeartbeatTestsOnly(), suite); + return suite; } public static Test suite(boolean defaultOnly) { - TestSuite suite = new TestSuite("Tests for org.eclipse.mylyn.trac.tests"); + TestSuite suite = new TestSuite(AllTracTests.class.getName()); + addTests(defaultOnly, suite); + return suite; + } + + private static void addTests(boolean defaultOnly, TestSuite suite) { suite.addTest(AllTracHeadlessStandaloneTests.suite(defaultOnly)); suite.addTestSuite(TracUtilTest.class); suite.addTestSuite(TracRepositoryQueryTest.class); @@ -51,7 +60,6 @@ public class AllTracTests { addTests(suite, fixture); } } - return suite; } protected static void addTests(TestSuite suite, TracFixture fixture) { |