Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-04-26 15:54:07 -0400
committerfbecker2010-04-26 15:54:07 -0400
commiteace0693fbc93941d3d4dcb33f1f5a437b42d37b (patch)
tree6b1e617dc095e768ed4ca134765b6742b78a8135 /org.eclipse.mylyn.bugzilla.tests
parentcd3da693c9e5e5eea095a5b9b55790838a33ab45 (diff)
downloadorg.eclipse.mylyn.tasks-eace0693fbc93941d3d4dcb33f1f5a437b42d37b.tar.gz
org.eclipse.mylyn.tasks-eace0693fbc93941d3d4dcb33f1f5a437b42d37b.tar.xz
org.eclipse.mylyn.tasks-eace0693fbc93941d3d4dcb33f1f5a437b42d37b.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/core/BugzillaXMLRPCTest.java32
1 files changed, 25 insertions, 7 deletions
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 7949f966d..36727f3d8 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
@@ -16,9 +16,11 @@ import java.util.HashMap;
import junit.framework.TestCase;
+import org.apache.xmlrpc.XmlRpcException;
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.BugzillaVersion;
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
/**
@@ -30,15 +32,8 @@ import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
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";
-
@Override
public void setUp() throws Exception {
-// 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(BugzillaFixture.current().getRepositoryUrl() + "/xmlrpc.cgi");
webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
bugzillaClient = new BugzillaXmlRpcClient(webLocation);
@@ -65,4 +60,27 @@ public class BugzillaXMLRPCTest extends TestCase {
int i = 9;
i++;
}
+
+ @SuppressWarnings("unused")
+ public void testxmlrpcInstalled() throws Exception {
+ int uID = bugzillaClient.login();
+ assertEquals(2, uID);
+ BugzillaFixture.current().getBugzillaVersion();
+ if (BugzillaFixture.current().getBugzillaVersion().compareTo(BugzillaVersion.BUGZILLA_3_6) == 0) {
+ uID = -1;
+ WebLocation webLocation = new WebLocation(BugzillaFixture.current().getRepositoryUrl()
+ + "noxmlrpc/xmlrpc.cgi");
+ webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
+ BugzillaXmlRpcClient bugzillaClientNoXMLRPC = new BugzillaXmlRpcClient(webLocation);
+ bugzillaClientNoXMLRPC.setContentTypeCheckingEnabled(true);
+ try {
+ uID = bugzillaClientNoXMLRPC.login();
+ fail("Never reach this! We should get an XmlRpcException");
+ } catch (XmlRpcException e) {
+ assertEquals("The server returned an unexpected content type: 'text/html; charset=UTF-8'",
+ e.getMessage());
+ }
+ }
+ }
+
}

Back to the top