summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-08-06 06:13:20 (EDT)
committer Steffen Pingel2012-08-06 09:03:04 (EDT)
commita6eccde206202d6ead6ec13730cbfe434690e25c (patch)
tree092dc8b4697b40c657b9bf7ee1bd5c6b70455a30
parent3fca4682e33f24b432ccb846188fc3f15ee5e0e4 (diff)
downloadorg.eclipse.mylyn.tasks-a6eccde206202d6ead6ec13730cbfe434690e25c.zip
org.eclipse.mylyn.tasks-a6eccde206202d6ead6ec13730cbfe434690e25c.tar.gz
org.eclipse.mylyn.tasks-a6eccde206202d6ead6ec13730cbfe434690e25c.tar.bz2
REOPENED - bug 386143: upgrade test servers to Bugzilla 4.2.2, 4.0.7,
and 3.6.10 https://bugs.eclipse.org/bugs/show_bug.cgi?id=386143 Change-Id: I85c5cef5008632906c3bba75f9a3b9ec7b711901
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java13
1 files changed, 10 insertions, 3 deletions
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 b81b0d5..63ebb89 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
@@ -42,6 +42,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tests.util.TestFixture;
+import org.eclipse.osgi.util.NLS;
/**
* @author Steffen Pingel
@@ -167,9 +168,7 @@ public class BugzillaFixture extends TestFixture {
TaskRepository taskRepository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, location.getUrl());
String repositoryURL = taskRepository.getUrl();
- String filepath = "testdata/repository"
- + repositoryURL.substring(repositoryURL.indexOf(TestConfiguration.getServerName())
- + TestConfiguration.getServerName().length()) + "/DesciptorFile.txt";
+ String filepath = "testdata/repository/" + getRepositoryName(location.getUrl()) + "/DesciptorFile.txt";
try {
File file = BugzillaFixture.getFile(filepath);
if (file != null) {
@@ -197,6 +196,14 @@ public class BugzillaFixture extends TestFixture {
return client;
}
+ private String getRepositoryName(String url) {
+ int i = url.lastIndexOf("/");
+ if (i == -1) {
+ throw new IllegalArgumentException(NLS.bind("Unable to determine repository name for {0}", url));
+ }
+ return url.substring(i);
+ }
+
public BugzillaClient client(PrivilegeLevel level) throws Exception {
AbstractWebLocation location = location(level);
return client(location, "UTF-8");