Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-04-26 15:17:31 -0400
committerfbecker2010-04-26 15:17:31 -0400
commitcd3da693c9e5e5eea095a5b9b55790838a33ab45 (patch)
treee2569fe49166bdfdc5021cc5101c84bd4e8ad0e8 /org.eclipse.mylyn.bugzilla.tests
parenta33d1ed98acafde2842811db15c6bc6cecac3076 (diff)
downloadorg.eclipse.mylyn.tasks-cd3da693c9e5e5eea095a5b9b55790838a33ab45.tar.gz
org.eclipse.mylyn.tasks-cd3da693c9e5e5eea095a5b9b55790838a33ab45.tar.xz
org.eclipse.mylyn.tasks-cd3da693c9e5e5eea095a5b9b55790838a33ab45.zip
ASSIGNED - bug 302654: support for Bugzilla 3.6
https://bugs.eclipse.org/bugs/show_bug.cgi?id=302654
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestConstants.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java25
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java9
7 files changed, 35 insertions, 16 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 837c8f2e8..67b7efc5e 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
@@ -14,6 +14,7 @@ package org.eclipse.mylyn.bugzilla.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.mylyn.bugzilla.tests.core.BugzillaXMLRPCTest;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaRepositorySettingsPageTest;
import org.eclipse.mylyn.bugzilla.tests.ui.BugzillaSearchPageTest;
@@ -60,6 +61,10 @@ public class AllBugzillaTests {
}
fixture.add(BugzillaAttachmentHandlerTest.class);
}
+ if (!fixture.getBugzillaVersion().isSmaller(BugzillaVersion.BUGZILLA_3_6)) {
+ fixture.add(BugzillaXMLRPCTest.class);
+ }
+
fixture.done();
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestConstants.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestConstants.java
index 633680834..7a824e8eb 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestConstants.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestConstants.java
@@ -39,9 +39,11 @@ public class BugzillaTestConstants {
public static final String TEST_BUGZILLA_34_URL = getServerUrl("bugs34");
+ public static final String TEST_BUGZILLA_36_URL = getServerUrl("bugs36");
+
public static final String TEST_BUGZILLA_HEAD_URL = getServerUrl("bugshead");
- public static final String TEST_BUGZILLA_LATEST_URL = TEST_BUGZILLA_34_URL;
+ public static final String TEST_BUGZILLA_LATEST_URL = TEST_BUGZILLA_36_URL;
private static final String getServerUrl(String version) {
return "http://" + SERVER + "/" + version;
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
index 063c768be..b7cc8f06d 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
@@ -188,13 +188,13 @@ public class BugzillaClientTest extends TestCase {
}
public void testLeadingZeros() throws Exception {
- String taskNumber = "0010";
+ String taskNumber = "0002";
TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
assertNotNull(taskData);
assertNotNull(taskData);
TaskAttribute idAttribute = taskData.getRoot().getAttribute(BugzillaAttribute.BUG_ID.getKey());
assertNotNull(idAttribute);
- assertEquals("10", idAttribute.getValue());
+ assertEquals("2", idAttribute.getValue());
}
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
index 822857a2a..be175973e 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
@@ -50,7 +50,7 @@ public class BugzillaCustomFieldsTest extends TestCase {
public void testCustomAttributes() throws Exception {
- String taskNumber = "1";
+ String taskNumber = "2";
TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
assertNotNull(taskData);
TaskMapper mapper = new TaskMapper(taskData);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java
index 1d7fff6a1..6e1b870a1 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java
@@ -40,7 +40,7 @@ public class BugzillaFlagsTest extends TestCase {
@SuppressWarnings("null")
public void testFlags() throws Exception {
- String taskNumber = "10";
+ String taskNumber = "2";
TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
assertNotNull(taskData);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java
index 9932cc361..7949f966d 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java
@@ -14,23 +14,32 @@ package org.eclipse.mylyn.bugzilla.tests.core;
import java.util.Date;
import java.util.HashMap;
-import org.eclipse.mylyn.bugzilla.tests.BugzillaTestConstants;
+import junit.framework.TestCase;
+
+import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
-public class BugzillaXMLRPCTest {
+/**
+ * Tests should be run against Bugzilla 3.6 or greater
+ *
+ * @author Frank Becker
+ */
+
+public class BugzillaXMLRPCTest extends TestCase {
private BugzillaXmlRpcClient bugzillaClient;
// private static String TEST_REPO = "http://.../Bugzilla36noRPC";
+// private static String TEST_REPO = "http://mylyn.eclipse.org/bugs36";
-// private static String TEST_REPO = "http://.../Bugzilla36";
-
+ @Override
public void setUp() throws Exception {
-// WebLocation webLocation = new WebLocation(TEST_REPO + "/xmlrpc.cgi");
// webLocation.setCredentials(AuthenticationType.REPOSITORY, "user", "password");
// webLocation.setCredentials(AuthenticationType.HTTP, "user", "password");
- WebLocation webLocation = new WebLocation(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL + "/xmlrpc.cgi");
+// WebLocation webLocation = new WebLocation(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL + "/xmlrpc.cgi");
+
+ WebLocation webLocation = new WebLocation(BugzillaFixture.current().getRepositoryUrl() + "/xmlrpc.cgi");
webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
bugzillaClient = new BugzillaXmlRpcClient(webLocation);
bugzillaClient.setContentTypeCheckingEnabled(true);
@@ -44,8 +53,8 @@ public class BugzillaXMLRPCTest {
Date x2 = bugzillaClient.getDBTime();
Date x3 = bugzillaClient.getWebTime();
Object[] xx0 = bugzillaClient.getUserInfoFromIDs(new Integer[] { 1, 2 });
- Object[] xx1 = bugzillaClient.getUserInfoFromNames(new String[] { "Frank@Frank-Becker.de" });
- Object[] xx2 = bugzillaClient.getUserInfoWithMatch(new String[] { "eck" });
+ Object[] xx1 = bugzillaClient.getUserInfoFromNames(new String[] { "tests@mylyn.eclipse.org" });
+ Object[] xx2 = bugzillaClient.getUserInfoWithMatch(new String[] { "est" });
Object[] xx3 = bugzillaClient.getAllFields();
Object[] xx4 = bugzillaClient.getFieldsWithNames(new String[] { "qa_contact" });
Object[] xx5 = bugzillaClient.getFieldsWithIDs(new Integer[] { 12, 18 });
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
index 569148f7d..17e2f9686 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
@@ -91,13 +91,16 @@ public class BugzillaFixture extends TestFixture {
public static BugzillaFixture BUGS_3_4 = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_34_URL, //
"3.4.4", "");
+ public static BugzillaFixture BUGS_3_6 = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_36_URL, //
+ "3.6", "");
+
public static BugzillaFixture BUGS_HEAD = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL, //
- "3.5.2+", "");
+ "3.7", "");
- public static BugzillaFixture DEFAULT = BUGS_3_4;
+ public static BugzillaFixture DEFAULT = BUGS_3_6;
public static final BugzillaFixture[] ALL = new BugzillaFixture[] { BUGS_2_22, BUGS_3_0, BUGS_3_2, BUGS_3_4,
- BUGS_HEAD };
+ BUGS_3_6, BUGS_HEAD };
private final String version;

Back to the top