Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java15
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java31
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaDateTimeTests.java19
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaSearchPageTest.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskEditorTest.java (renamed from org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/TaskEditorTest.java)2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java10
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java26
7 files changed, 45 insertions, 59 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
index 4442543db..9b5b9a718 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
@@ -24,7 +24,7 @@ import org.eclipse.mylyn.bugzilla.tests.core.BugzillaRepositoryConnectorStandalo
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaTaskCompletionTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaVersionTest;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
/**
@@ -35,18 +35,19 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
public class AllBugzillaHeadlessStandaloneTests {
public static Test suite() {
- return suite(false, CommonTestUtil.runHeartbeatTestsOnly());
+ return suite(TestConfiguration.getDefault());
}
- public static Test suite(boolean localOnly, boolean defaultOnly) {
+ public static Test suite(TestConfiguration configuration) {
TestSuite suite = new TestSuite(AllBugzillaHeadlessStandaloneTests.class.getName());
- // tests that only need to run once (i.e. no network i/o so doesn't matter which repository)
suite.addTestSuite(BugzillaConfigurationTest.class);
suite.addTestSuite(BugzillaVersionTest.class);
- suite.addTestSuite(BugzillaTaskCompletionTest.class);
- if (!localOnly) {
+ suite.addTestSuite(BugzillaDateTimeTests.class);
+ if (!configuration.isLocalOnly()) {
+ // network tests
+ suite.addTestSuite(BugzillaTaskCompletionTest.class);
// tests that run against all repository versions
- if (defaultOnly) {
+ if (configuration.isDefaultOnly()) {
addTests(suite, BugzillaFixture.DEFAULT);
} else {
for (BugzillaFixture fixture : BugzillaFixture.ALL) {
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 c195f2519..465e9879e 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
@@ -20,10 +20,10 @@ import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaHyperlinkDetectorTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaRepositorySettingsPageTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaSearchPageTest;
+import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaTaskEditorTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaTaskHyperlinkDetectorTest;
-import org.eclipse.mylyn.bugzilla.tests.ui.TaskEditorTest;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
+import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
/**
* @author Mik Kersten
@@ -34,37 +34,30 @@ public class AllBugzillaTests {
public static Test suite() {
TestSuite suite = new ManagedTestSuite(AllBugzillaTests.class.getName());
- addTests(false, CommonTestUtil.runHeartbeatTestsOnly(), suite);
+ addTests(suite, TestConfiguration.getDefault());
return suite;
}
- public static Test suite(boolean defaultOnly) {
+ public static Test suite(TestConfiguration configuration) {
TestSuite suite = new TestSuite(AllBugzillaTests.class.getName());
- addTests(false, defaultOnly, suite);
+ addTests(suite, configuration);
return suite;
}
- public static Test localSuite() {
- TestSuite suite = new TestSuite(AllBugzillaTests.class.getName());
- addTests(true, CommonTestUtil.runHeartbeatTestsOnly(), suite);
- return suite;
- }
-
- private static void addTests(boolean localOnly, boolean defaultOnly, TestSuite suite) {
+ public static void addTests(TestSuite suite, TestConfiguration configuration) {
// Standalone tests (Don't require an instance of Eclipse)
- suite.addTest(AllBugzillaHeadlessStandaloneTests.suite(localOnly, defaultOnly));
+ suite.addTest(AllBugzillaHeadlessStandaloneTests.suite(configuration));
// Tests that only need to run once (i.e. no network io so doesn't matter which repository)
- suite.addTestSuite(TaskEditorTest.class);
- suite.addTestSuite(BugzillaRepositorySettingsPageTest.class);
- suite.addTestSuite(BugzillaSearchPageTest.class);
- suite.addTestSuite(BugzillaDateTimeTests.class);
suite.addTestSuite(BugzillaTaskHyperlinkDetectorTest.class);
suite.addTestSuite(BugzillaHyperlinkDetectorTest.class);
// network tests
- if (!localOnly) {
- if (defaultOnly) {
+ if (!configuration.isLocalOnly()) {
+ suite.addTestSuite(BugzillaTaskEditorTest.class);
+ suite.addTestSuite(BugzillaSearchPageTest.class);
+ suite.addTestSuite(BugzillaRepositorySettingsPageTest.class);
+ if (configuration.isDefaultOnly()) {
addTests(suite, BugzillaFixture.DEFAULT);
} else {
for (BugzillaFixture fixture : BugzillaFixture.ALL) {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaDateTimeTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaDateTimeTests.java
index 6870d6d97..3a663603a 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaDateTimeTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaDateTimeTests.java
@@ -15,35 +15,31 @@ import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
-import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
+import junit.framework.TestCase;
+
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tests.util.TestUtil.PrivilegeLevel;
/**
* @author Frank Becker
* @author Robert Elves
+ * @author Steffen Pingel
*/
-public class BugzillaDateTimeTests extends AbstractBugzillaTest {
+public class BugzillaDateTimeTests extends TestCase {
private TaskRepository repository;
private BugzillaRepositoryConnector connector;
- @SuppressWarnings("unused")
- private BugzillaClient client;
-
@Override
public void setUp() throws Exception {
- super.setUp();
- client = BugzillaFixture.current().client(PrivilegeLevel.USER);
- repository = BugzillaFixture.current().repository();
- connector = BugzillaFixture.current().connector();
+ repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, "http://mylyn.org");
+ connector = new BugzillaRepositoryConnector();
}
public void testDateFormatParsing() {
@@ -134,4 +130,5 @@ public class BugzillaDateTimeTests extends AbstractBugzillaTest {
TimeZone.setDefault(defaultTimeZone);
}
}
+
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaSearchPageTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaSearchPageTest.java
index bdd70987a..1f9f7152d 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaSearchPageTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaSearchPageTest.java
@@ -49,4 +49,5 @@ public class BugzillaSearchPageTest extends TestCase {
*/
assertFalse(page.getProductCount() == 0);
}
+
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/TaskEditorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskEditorTest.java
index d9eeaee17..ee7b99945 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/TaskEditorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskEditorTest.java
@@ -27,7 +27,7 @@ import org.eclipse.ui.PlatformUI;
* @author Jeff Pound
* @author Steffen Pingel
*/
-public class TaskEditorTest extends TestCase {
+public class BugzillaTaskEditorTest extends TestCase {
private TaskRepository repository;
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 90206e93f..f91121ab2 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
@@ -14,7 +14,7 @@ package org.eclipse.mylyn.trac.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.trac.tests.client.TracClientFactoryTest;
import org.eclipse.mylyn.trac.tests.client.TracClientProxyTest;
@@ -32,10 +32,10 @@ import org.eclipse.mylyn.trac.tests.support.TracFixture;
public class AllTracHeadlessStandaloneTests {
public static Test suite() {
- return suite(false, CommonTestUtil.runHeartbeatTestsOnly());
+ return suite(TestConfiguration.getDefault());
}
- public static Test suite(boolean localOnly, boolean defaultOnly) {
+ public static Test suite(TestConfiguration configuration) {
TestSuite suite = new TestSuite(AllTracHeadlessStandaloneTests.class.getName());
// client tests
suite.addTestSuite(TracSearchTest.class);
@@ -45,8 +45,8 @@ public class AllTracHeadlessStandaloneTests {
// core tests
suite.addTestSuite(TracClientManagerTest.class);
// network tests
- if (!localOnly) {
- if (defaultOnly) {
+ if (!configuration.isLocalOnly()) {
+ if (configuration.isDefaultOnly()) {
addTests(suite, TracFixture.DEFAULT);
} else {
for (TracFixture fixture : TracFixture.ALL) {
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 1cb23227c..e7262ff13 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,8 +14,8 @@ package org.eclipse.mylyn.trac.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
+import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.trac.tests.core.TracAttachmentHandlerTest;
import org.eclipse.mylyn.trac.tests.core.TracRepositoryConnectorTest;
@@ -35,33 +35,27 @@ public class AllTracTests {
public static Test suite() {
TestSuite suite = new ManagedTestSuite(AllTracTests.class.getName());
- addTests(false, CommonTestUtil.runHeartbeatTestsOnly(), suite);
+ addTests(suite, TestConfiguration.getDefault());
return suite;
}
- public static Test suite(boolean defaultOnly) {
+ public static Test suite(TestConfiguration configuration) {
TestSuite suite = new TestSuite(AllTracTests.class.getName());
- addTests(false, defaultOnly, suite);
+ addTests(suite, configuration);
return suite;
}
- public static Test localSuite() {
- TestSuite suite = new TestSuite(AllTracTests.class.getName());
- addTests(true, CommonTestUtil.runHeartbeatTestsOnly(), suite);
- return suite;
- }
-
- private static void addTests(boolean localOnly, boolean defaultOnly, TestSuite suite) {
- suite.addTest(AllTracHeadlessStandaloneTests.suite(localOnly, defaultOnly));
+ public static void addTests(TestSuite suite, TestConfiguration configuration) {
+ suite.addTest(AllTracHeadlessStandaloneTests.suite(configuration));
suite.addTestSuite(TracUtilTest.class);
- suite.addTestSuite(TracRepositoryQueryTest.class);
// XXX fails when run from continuous build: suite.addTestSuite(TracTaskEditorTest.class);
- suite.addTestSuite(TracRepositorySettingsPageTest.class);
suite.addTestSuite(TracHyperlinkUtilTest.class);
- if (!localOnly) {
+ if (!configuration.isLocalOnly()) {
+ suite.addTestSuite(TracRepositoryQueryTest.class);
+ suite.addTestSuite(TracRepositorySettingsPageTest.class);
// network tests
- if (defaultOnly) {
+ if (configuration.isDefaultOnly()) {
addTests(suite, TracFixture.DEFAULT);
} else {
for (TracFixture fixture : TracFixture.ALL) {

Back to the top