Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-07-17 05:16:45 +0000
committerSteffen Pingel2012-07-20 10:48:30 +0000
commitb0223aa749293b1a40363746fdf0059cd6bff010 (patch)
treea650a1cce1b30b8f27fa7b83e28bcc6b96684cc9
parentc185b28ae9129382beeb6f3d35c99429e0ad8883 (diff)
downloadorg.eclipse.mylyn.tasks-b0223aa749293b1a40363746fdf0059cd6bff010.tar.gz
org.eclipse.mylyn.tasks-b0223aa749293b1a40363746fdf0059cd6bff010.tar.xz
org.eclipse.mylyn.tasks-b0223aa749293b1a40363746fdf0059cd6bff010.zip
NEW - bug 382194: Submitting new bug against product with spaces in
product name fails on bugzilla 4.2 https://bugs.eclipse.org/bugs/show_bug.cgi?id=382194 Change-Id: Iaf08595bb278584981fff89bf1da60a27a8a0f2e
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java8
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java4
4 files changed, 13 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index a8ebe39af..cf985898c 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -26,6 +26,7 @@ import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLDecoder;
+import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.util.ArrayList;
@@ -1311,7 +1312,9 @@ public class BugzillaClient {
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) > 0) {
TaskAttribute productAttribute = taskData.getRoot().getAttribute(BugzillaAttribute.PRODUCT.getKey());
token = getTokenInternal(
- taskData.getRepositoryUrl() + ENTER_BUG_PRODUCT_CGI + productAttribute.getValue(), monitor);
+ taskData.getRepositoryUrl() + ENTER_BUG_PRODUCT_CGI
+ + URLEncoder.encode(productAttribute.getValue(), IBugzillaConstants.ENCODING_UTF_8),
+ monitor);
}
formData = getPairsForNew(taskData, token);
} else {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
index 48dc8f9ab..f1b61d4c4 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
@@ -26,6 +26,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -57,7 +58,6 @@ import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.core.data.TaskOperation;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Rob Elves
@@ -518,7 +518,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
@Override
public String getProduct() {
- return "Scratch";
+ return "Product with Spaces";
}
};
final TaskMapping taskMappingSelect = new TaskMapping() {
@@ -529,7 +529,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
@Override
public String getSummary() {
- return "test the std workflow for Scratch";
+ return "test the std workflow for Product with Spaces";
}
@Override
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 794c12c26..5b1f3c8d6 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
@@ -24,6 +24,7 @@ import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
@@ -40,7 +41,6 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
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.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.tests.util.UrlBuilder;
/**
@@ -104,9 +104,9 @@ public class BugzillaClientTest extends TestCase {
assertEquals(2, config.getComponents("TestProduct").size());
assertEquals(4, config.getVersions("TestProduct").size());
assertEquals(4, config.getTargetMilestones("TestProduct").size());
- assertEquals(2, config.getComponents("Scratch").size());
- assertEquals(4, config.getVersions("Scratch").size());
- assertEquals(4, config.getTargetMilestones("Scratch").size());
+ assertEquals(2, config.getComponents("Product with Spaces").size());
+ assertEquals(4, config.getVersions("Product with Spaces").size());
+ assertEquals(4, config.getTargetMilestones("Product with Spaces").size());
}
public void testValidate() throws Exception {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
index 767eda0f0..1fc0acf8f 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
@@ -34,6 +34,7 @@ import org.eclipse.core.runtime.SubProgressMonitor;
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.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.AbstractBugzillaOperation;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
@@ -67,7 +68,6 @@ import org.eclipse.mylyn.tasks.core.sync.SubmitJob;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tests.util.TestFixture;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* Tests should be run against Bugzilla 3.6 or greater
@@ -983,7 +983,7 @@ public class BugzillaXmlRpcClientTest extends TestCase {
bugzillaClient.updateProductInfo(new NullProgressMonitor(), repositoryConfiguration);
for (String product : repositoryConfiguration.getProducts()) {
- if (product.equals("ManualTest") || product.equals("Scratch") || product.equals("TestProduct")) {
+ if (product.equals("ManualTest") || product.equals("Product with Spaces") || product.equals("TestProduct")) {
assertEquals("---", repositoryConfiguration.getDefaultMilestones(product));
} else {
fail("never reach this");

Back to the top