Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-12-05 17:33:57 +0000
committerSimon Kaegi2008-12-05 17:33:57 +0000
commit4d53c7196be68713959a9c7eac707c4068f37075 (patch)
treebf3f6c3791ac2351dd340a810e2ba8583950b1a4 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator
parent6789937e79722dda45fa847d2c8bb595dfd46deb (diff)
downloadrt.equinox.p2-4d53c7196be68713959a9c7eac707c4068f37075.tar.gz
rt.equinox.p2-4d53c7196be68713959a9c7eac707c4068f37075.tar.xz
rt.equinox.p2-4d53c7196be68713959a9c7eac707c4068f37075.zip
Bug 257613 SimpleConfigurator doesn't launch workspace bundles with a space in the path
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
index a2d497130..622130f4d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
@@ -54,6 +54,38 @@ public class SimpleConfiguratorUtilsTest extends AbstractProvisioningTest {
}
}
+ public void testParseBundleInfoWithSpaces() throws MalformedURLException {
+
+ File baseFile = getTempFolder();
+ URI baseURI = baseFile.toURI();
+
+ String canonicalForm = "javax.servlet,2.4.0.v200806031604,plugin%20s/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo canonicalInfo = SimpleConfiguratorUtils.parseBundleInfoLine(canonicalForm, baseURI);
+ File canonicalFile = new File(baseFile, "plugin s/javax.servlet_2.4.0.v200806031604.jar");
+
+ String line[] = new String[6];
+ line[0] = "javax.servlet,2.4.0.v200806031604,file:plugin s/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[1] = "javax.servlet,2.4.0.v200806031604,plugin s\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[2] = "javax.servlet,2.4.0.v200806031604,file:plugin s\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[3] = "javax.servlet,2.4.0.v200806031604,file:" + canonicalFile.toString() + ",4,false";
+ line[4] = "javax.servlet,2.4.0.v200806031604," + canonicalFile.toURL().toExternalForm() + ",4,false";
+ line[5] = "javax.servlet,2.4.0.v200806031604," + canonicalFile.toURI().toString() + ",4,false";
+
+ String relativeBundleLocation = "reference:file:plugin s/javax.servlet_2.4.0.v200806031604.jar";
+ String absoluteBundleLocation = "reference:" + canonicalFile.toURL().toExternalForm();
+
+ for (int i = 0; i < line.length; i++) {
+ if (line[i].indexOf('\\') != -1 && !WINDOWS)
+ continue;
+ BundleInfo info = SimpleConfiguratorUtils.parseBundleInfoLine(line[i], baseURI);
+ assertEquals("[" + i + "]", canonicalInfo, info);
+ if (info.getLocation().isAbsolute())
+ assertEquals("[" + i + "]", absoluteBundleLocation, SimpleConfiguratorUtils.getBundleLocation(info, true));
+ else
+ assertEquals("[" + i + "]", relativeBundleLocation, SimpleConfiguratorUtils.getBundleLocation(info, true));
+ }
+ }
+
public void testParseUNCBundleInfo() throws MalformedURLException {
if (!WINDOWS)

Back to the top