Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-08-06 10:13:20 +0000
committerSteffen Pingel2012-08-06 10:13:20 +0000
commit10fcea1fc458ba6b29241f4d67e17fee0f0bddbe (patch)
treea1a83a676bcb77613b7bdfc13a218358ed88b201
parent2398867719ca205a8b39b00bbaecef5b3eb2d995 (diff)
downloadorg.eclipse.mylyn.tasks-10fcea1fc458ba6b29241f4d67e17fee0f0bddbe.tar.gz
org.eclipse.mylyn.tasks-10fcea1fc458ba6b29241f4d67e17fee0f0bddbe.tar.xz
org.eclipse.mylyn.tasks-10fcea1fc458ba6b29241f4d67e17fee0f0bddbe.zip
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 b81b0d5a0..63ebb8938 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");

Back to the top