summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-09-16 12:36:16 (EDT)
committerSteffen Pingel2011-09-16 13:29:26 (EDT)
commitf0a938ef1ecb5be71a68e7203e65bdfcea888d3c (patch)
tree8ca1df373b8717a7bba56ad845197eab38c494aa
parent6e184421ca62955dc533b039f58e824abb4786c6 (diff)
downloadorg.eclipse.mylyn.tasks-f0a938ef1ecb5be71a68e7203e65bdfcea888d3c.zip
org.eclipse.mylyn.tasks-f0a938ef1ecb5be71a68e7203e65bdfcea888d3c.tar.gz
org.eclipse.mylyn.tasks-f0a938ef1ecb5be71a68e7203e65bdfcea888d3c.tar.bz2
bug 309255: unable to open the trac ticket
https://bugs.eclipse.org/bugs/show_bug.cgi?id=309255 Change-Id: Ie878e68336aa3bcf41c39bfaaac6c38fd11cc2e3
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracClientFactory.java5
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java9
2 files changed, 6 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracClientFactory.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracClientFactory.java
index 1ce976a..a444338 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracClientFactory.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracClientFactory.java
@@ -16,11 +16,11 @@ import java.net.MalformedURLException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
+import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.internal.trac.core.client.TracException;
import org.eclipse.mylyn.internal.trac.core.client.TracLoginException;
import org.eclipse.mylyn.internal.trac.core.client.TracWebClient;
import org.eclipse.mylyn.internal.trac.core.client.TracXmlRpcClient;
-import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
/**
* @author Steffen Pingel
@@ -34,7 +34,8 @@ public class TracClientFactory {
return new TracXmlRpcClient(location, version);
}
- throw new RuntimeException("Invalid repository version: " + version); //$NON-NLS-1$
+ // fall-back to XML_RPC in case the repository information is incomplete
+ return new TracXmlRpcClient(location, Version.XML_RPC);
}
/**
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java
index 27a7a41..31a6e5f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientFactoryTest.java
@@ -49,12 +49,9 @@ public class TracClientFactoryTest extends TestCase {
}
public void testCreateClientNull() throws Exception {
- try {
- WebLocation location = new WebLocation(fixture.getRepositoryUrl(), "user", "password");
- TracClientFactory.createClient(location, null);
- fail("Expected Exception");
- } catch (Exception e) {
- }
+ WebLocation location = new WebLocation(fixture.getRepositoryUrl(), "user", "password");
+ ITracClient client = TracClientFactory.createClient(location, null);
+ assertEquals(Version.XML_RPC, client.getAccessMode());
}
public void testProbeClient() throws Exception {