Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2008-11-25 19:51:23 +0000
committerDJ Houghton2008-11-25 19:51:23 +0000
commit9532e99fe38608885b871fcd2d361020b89f12c0 (patch)
tree03c7edfe0d37b0a9e7798456585ecfe1c59a5a53 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse
parent4722ab4bc3574c191036f1014c05334977736d35 (diff)
downloadrt.equinox.p2-9532e99fe38608885b871fcd2d361020b89f12c0.tar.gz
rt.equinox.p2-9532e99fe38608885b871fcd2d361020b89f12c0.tar.xz
rt.equinox.p2-9532e99fe38608885b871fcd2d361020b89f12c0.zip
Merged path_fun_2008 branch.v20081125_postPathFunMerge
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTests.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java110
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/AllTests.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtilsTest.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java5
15 files changed, 223 insertions, 23 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java
index 7126c141f..706152760 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java
@@ -38,6 +38,7 @@ public class AutomatedTests extends TestCase {
suite.addTest(org.eclipse.equinox.p2.tests.planner.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.publisher.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.simpleconfigurator.SimpleConfiguratorTests.suite());
+ suite.addTest(org.eclipse.equinox.p2.tests.simpleconfigurator.manipulator.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.updatesite.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.touchpoint.eclipse.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.reconciler.dropins.AllTests.suite());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java
index 11e13371f..e18f9a8bc 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java
@@ -11,6 +11,7 @@
package org.eclipse.equinox.p2.tests.publisher.actions;
import java.io.File;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Properties;
import org.easymock.Capture;
@@ -19,6 +20,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.provisional.frameworkadmin.ConfigData;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.URIUtil;
import org.eclipse.equinox.p2.publisher.eclipse.*;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -53,18 +55,18 @@ public class AccumulateConfigDataActionTest extends ActionTest {
debug("Completed AccumulateConfigDataActionTest."); //$NON-NLS-1$
}
- private void verifyLaunchAdvice() {
+ private void verifyLaunchAdvice() throws URISyntaxException {
LaunchingAdvice captured = launchingAdviceCapture.getValue();
String[] programArgs = captured.getProgramArguments();
assertTrue(programArgs.length == 4);
assertTrue(programArgs[0].equalsIgnoreCase("-startup")); //$NON-NLS-1$
Path path1 = new Path(TestActivator.getTestDataFolder().getPath() + FOO);
- assertTrue(new Path(programArgs[1]).equals(path1));
+ assertTrue(path1.toFile().toURI().equals(URIUtil.fromString(programArgs[1])));
assertTrue(programArgs[2].equalsIgnoreCase("--launcher.library"));//$NON-NLS-1$
Path path2 = new Path(TestActivator.getTestDataFolder().getPath() + BAR);
- assertTrue(new Path(programArgs[3]).equals(path2));
+ assertTrue(path2.toFile().toURI().equals(URIUtil.fromString(programArgs[3])));
String[] vmArgs = captured.getVMArguments();
assertTrue(vmArgs.length == 0);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTests.java
index 8d50c5015..a3b448fa5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorTests.java
@@ -16,6 +16,7 @@ public class SimpleConfiguratorTests {
public static Test suite() {
TestSuite suite = new TestSuite("Tests for org.eclipse.equinox.simpleconfigurator");
//$JUnit-BEGIN$
+ suite.addTestSuite(SimpleConfiguratorUtilsTest.class);
suite.addTestSuite(BundlesTxtTest.class);
suite.addTestSuite(NonExclusiveMode.class);
//$JUnit-END$
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
new file mode 100644
index 000000000..a0722c49a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.simpleconfigurator;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.*;
+import java.util.List;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+
+public class SimpleConfiguratorUtilsTest extends AbstractProvisioningTest {
+
+ public void testParseBundleInfo() throws MalformedURLException {
+
+ File baseFile = getTempFolder();
+ URI baseURI = baseFile.toURI();
+
+ String canonicalForm = "javax.servlet,2.4.0.v200806031604,plugins/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo canonicalInfo = SimpleConfiguratorUtils.parseBundleInfoLine(canonicalForm, baseURI);
+ File canonicalFile = new File(baseFile, "plugins/javax.servlet_2.4.0.v200806031604.jar");
+
+ String line[] = new String[7];
+ line[0] = "javax.servlet,2.4.0.v200806031604,file:plugins/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[1] = "javax.servlet,2.4.0.v200806031604,plugins\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[2] = "javax.servlet,2.4.0.v200806031604,file:plugins\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[3] = "javax.servlet,2.4.0.v200806031604,file:plugins\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[4] = "javax.servlet,2.4.0.v200806031604,file:" + canonicalFile.toString() + ",4,false";
+ line[5] = "javax.servlet,2.4.0.v200806031604," + canonicalFile.toURL().toExternalForm() + ",4,false";
+ line[6] = "javax.servlet,2.4.0.v200806031604," + canonicalFile.toURI().toString() + ",4,false";
+
+ String relativeBundleLocation = "reference:file:plugins/javax.servlet_2.4.0.v200806031604.jar";
+ String absoluteBundleLocation = "reference:" + canonicalFile.toURL().toExternalForm();
+
+ for (int i = 0; i < line.length; i++) {
+ 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 {
+
+ File baseFile = new File("\\\\127.0.0.1\\somefolder\\");
+ URI baseURI = baseFile.toURI();
+
+ String canonicalForm = "javax.servlet,2.4.0.v200806031604,plugins/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo canonicalInfo = SimpleConfiguratorUtils.parseBundleInfoLine(canonicalForm, baseURI);
+ File canonicalFile = new File(baseFile, "plugins/javax.servlet_2.4.0.v200806031604.jar");
+
+ String line[] = new String[4];
+ line[0] = "javax.servlet,2.4.0.v200806031604,file:plugins/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[1] = "javax.servlet,2.4.0.v200806031604,plugins\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[2] = "javax.servlet,2.4.0.v200806031604,file:plugins\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+ line[3] = "javax.servlet,2.4.0.v200806031604,file:plugins\\javax.servlet_2.4.0.v200806031604.jar,4,false";
+
+ //TODO: we need to fix URI.resolve for UNC paths
+ //line[4] = "javax.servlet,2.4.0.v200806031604," + canonicalFile.toURI().toString() + ",4,false";
+
+ String relativeBundleLocation = "reference:file:plugins/javax.servlet_2.4.0.v200806031604.jar";
+ String absoluteBundleLocation = "reference:" + canonicalFile.toURL().toExternalForm();
+
+ for (int i = 0; i < line.length; i++) {
+ 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 testRead34BundlesInfo() {
+
+ File data = getTestData("1.0", "testData/simpleConfiguratorTest/3.4.bundles.info");
+ try {
+ URI baseLocation = new URI("file:/c:/tmp/foo");
+ List infos = SimpleConfiguratorUtils.readConfiguration(data.toURL(), baseLocation);
+ assertEquals("1.1", 2, infos.size());
+
+ BundleInfo a = new BundleInfo("a", "1.0.0", new URI("plugins/a_1.0.0.jar"), 4, false);
+ a.setBaseLocation(baseLocation);
+ BundleInfo b = new BundleInfo("b", "1.0.0", new URI("plugins/b_1.0.0.jar"), -1, true);
+ b.setBaseLocation(baseLocation);
+
+ assertEquals("1.2", a, infos.get(0));
+ assertEquals("1.3", b, infos.get(1));
+
+ } catch (URISyntaxException e) {
+ fail("1.97", e);
+ } catch (MalformedURLException e) {
+ fail("1.98", e);
+ } catch (IOException e) {
+ fail("1.99", e);
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/AllTests.java
new file mode 100644
index 000000000..e8ed347c3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/AllTests.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.simpleconfigurator.manipulator;
+
+import junit.framework.*;
+
+/**
+ * Performs all automated director tests.
+ */
+public class AllTests extends TestCase {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(AllTests.class.getName());
+ suite.addTestSuite(SimpleConfiguratorManipulatorUtilsTest.class);
+ return suite;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtilsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtilsTest.java
new file mode 100644
index 000000000..e3a2d51a1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtilsTest.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.simpleconfigurator.manipulator;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import org.eclipse.equinox.internal.simpleconfigurator.manipulator.SimpleConfiguratorManipulatorUtils;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+
+public class SimpleConfiguratorManipulatorUtilsTest extends AbstractProvisioningTest {
+
+ public void testWriteBundleInfoLine() throws URISyntaxException, IOException {
+ String expectedLine = "javax.servlet,2.4.0.v200806031604,plugins/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo bundleInfo = new BundleInfo("javax.servlet", "2.4.0.v200806031604", new URI("plugins/javax.servlet_2.4.0.v200806031604.jar"), 4, false);
+ String line = SimpleConfiguratorManipulatorUtils.createBundleInfoLine(bundleInfo);
+ assertEquals(expectedLine, line);
+ assertEquals(bundleInfo, SimpleConfiguratorUtils.parseBundleInfoLine(line, null));
+ }
+
+ public void testWriteBundleInfoLineWithComma() throws URISyntaxException, IOException {
+ String expectedLine = "javax.servlet,2.4.0.v200806031604,plugin%2Cs/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo bundleInfo = new BundleInfo("javax.servlet", "2.4.0.v200806031604", new URI("plugin,s/javax.servlet_2.4.0.v200806031604.jar"), 4, false);
+ String line = SimpleConfiguratorManipulatorUtils.createBundleInfoLine(bundleInfo);
+ assertEquals(expectedLine, line);
+ assertEquals(bundleInfo, SimpleConfiguratorUtils.parseBundleInfoLine(line, null));
+ }
+
+ public void testWriteBundleInfoLineWithSpace() throws URISyntaxException, IOException {
+ String expectedLine = "javax.servlet,2.4.0.v200806031604,plugin%20s/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo bundleInfo = new BundleInfo("javax.servlet", "2.4.0.v200806031604", new URI("plugin%20s/javax.servlet_2.4.0.v200806031604.jar"), 4, false);
+ String line = SimpleConfiguratorManipulatorUtils.createBundleInfoLine(bundleInfo);
+ assertEquals(expectedLine, line);
+ assertEquals(bundleInfo, SimpleConfiguratorUtils.parseBundleInfoLine(line, null));
+ }
+
+ public void testWriteBundleInfoLineWithAtSymbol() throws URISyntaxException, IOException {
+ String expectedLine = "javax.servlet,2.4.0.v200806031604,plugin@s/javax.servlet_2.4.0.v200806031604.jar,4,false";
+ BundleInfo bundleInfo = new BundleInfo("javax.servlet", "2.4.0.v200806031604", new URI("plugin@s/javax.servlet_2.4.0.v200806031604.jar"), 4, false);
+ String line = SimpleConfiguratorManipulatorUtils.createBundleInfoLine(bundleInfo);
+ assertEquals(expectedLine, line);
+ assertEquals(bundleInfo, SimpleConfiguratorUtils.parseBundleInfoLine(line, null));
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java
index 8c2a82b46..b843c661e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.util.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ActionConstants;
@@ -79,7 +80,7 @@ public class AddSourceBundleActionTest extends AbstractProvisioningTest {
}
private boolean inBundles(SourceManipulator manipulator, File osgiTarget) throws IOException {
- String location = osgiTarget.toURL().toExternalForm();
+ URI location = osgiTarget.toURI();
BundleInfo[] bundles = manipulator.getBundles();
for (int i = 0; i < bundles.length; i++) {
if (location.equals(bundles[i].getLocation()))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java
index f134c25d0..e01d82325 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.util.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util;
@@ -80,8 +81,8 @@ public class InstallBundleActionTest extends AbstractProvisioningTest {
assertFalse(inBundles(manipulator, osgiTarget));
}
- private boolean inBundles(Manipulator manipulator, File osgiTarget) throws IOException {
- String location = osgiTarget.toURL().toExternalForm();
+ private boolean inBundles(Manipulator manipulator, File osgiTarget) {
+ URI location = osgiTarget.toURI();
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (location.equals(bundles[i].getLocation()))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java
index 91cf3ba87..5d4ecd0b5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.util.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util;
@@ -83,8 +84,8 @@ public class MarkStartedActionTest extends AbstractProvisioningTest {
assertTrue(isMarkedStarted(manipulator, osgiTarget, false));
}
- private boolean isMarkedStarted(Manipulator manipulator, File osgiTarget, boolean started) throws IOException {
- String location = osgiTarget.toURL().toExternalForm();
+ private boolean isMarkedStarted(Manipulator manipulator, File osgiTarget, boolean started) {
+ URI location = osgiTarget.toURI();
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (location.equals(bundles[i].getLocation()) && (started == bundles[i].isMarkedAsStarted()))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java
index 8fb4f1b65..f87e6dc3a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.util.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ActionConstants;
@@ -70,7 +71,7 @@ public class RemoveSourceBundleActionTest extends AbstractProvisioningTest {
SourceManipulator manipulator = (SourceManipulator) parameters.get(EclipseTouchpoint.PARM_SOURCE_BUNDLES);
assertNotNull(manipulator);
- manipulator.addBundle(osgiTarget);
+ manipulator.addBundle(osgiTarget, key.getId(), key.getVersion());
assertTrue(inBundles(manipulator, osgiTarget));
RemoveSourceBundleAction action = new RemoveSourceBundleAction();
action.execute(parameters);
@@ -80,7 +81,7 @@ public class RemoveSourceBundleActionTest extends AbstractProvisioningTest {
}
private boolean inBundles(SourceManipulator manipulator, File osgiTarget) throws IOException {
- String location = osgiTarget.toURL().toExternalForm();
+ URI location = osgiTarget.toURI();
BundleInfo[] bundles = manipulator.getBundles();
for (int i = 0; i < bundles.length; i++) {
if (location.equals(bundles[i].getLocation()))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java
index 909edd96e..284b7676e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java
@@ -42,15 +42,15 @@ public class SetFrameworkDependentPropertyActionTest extends AbstractProvisionin
String frameworkDependentPropertyName = "test";
String frameworkDependentPropertyValue = "true";
- assertFalse(manipulator.getConfigData().getFwDependentProps().containsKey(frameworkDependentPropertyName));
+ assertFalse(manipulator.getConfigData().getProperties().containsKey(frameworkDependentPropertyName));
parameters.put(ActionConstants.PARM_PROP_NAME, frameworkDependentPropertyName);
parameters.put(ActionConstants.PARM_PROP_VALUE, frameworkDependentPropertyValue);
parameters = Collections.unmodifiableMap(parameters);
SetFrameworkDependentPropertyAction action = new SetFrameworkDependentPropertyAction();
action.execute(parameters);
- assertEquals("true", manipulator.getConfigData().getFwDependentProp(frameworkDependentPropertyName));
+ assertEquals("true", manipulator.getConfigData().getProperty(frameworkDependentPropertyName));
action.undo(parameters);
- assertFalse(manipulator.getConfigData().getFwDependentProps().containsKey(frameworkDependentPropertyName));
+ assertFalse(manipulator.getConfigData().getProperties().containsKey(frameworkDependentPropertyName));
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java
index 46fcdf31f..8cad52796 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java
@@ -42,15 +42,15 @@ public class SetFrameworkIndependentPropertyActionTest extends AbstractProvision
String frameworkDependentPropertyName = "test";
String frameworkDependentPropertyValue = "true";
- assertFalse(manipulator.getConfigData().getFwIndependentProps().containsKey(frameworkDependentPropertyName));
+ assertFalse(manipulator.getConfigData().getProperties().containsKey(frameworkDependentPropertyName));
parameters.put(ActionConstants.PARM_PROP_NAME, frameworkDependentPropertyName);
parameters.put(ActionConstants.PARM_PROP_VALUE, frameworkDependentPropertyValue);
parameters = Collections.unmodifiableMap(parameters);
SetFrameworkIndependentPropertyAction action = new SetFrameworkIndependentPropertyAction();
action.execute(parameters);
- assertEquals("true", manipulator.getConfigData().getFwIndependentProp(frameworkDependentPropertyName));
+ assertEquals("true", manipulator.getConfigData().getProperty(frameworkDependentPropertyName));
action.undo(parameters);
- assertFalse(manipulator.getConfigData().getFwIndependentProps().containsKey(frameworkDependentPropertyName));
+ assertFalse(manipulator.getConfigData().getProperties().containsKey(frameworkDependentPropertyName));
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java
index 7d5b00920..6e7e7c8ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java
@@ -42,16 +42,16 @@ public class SetProgramPropertyActionTest extends AbstractProvisioningTest {
String frameworkDependentPropertyName = "test";
String frameworkDependentPropertyValue = "true";
- assertFalse(manipulator.getConfigData().getFwDependentProps().containsKey(frameworkDependentPropertyName));
+ assertFalse(manipulator.getConfigData().getProperties().containsKey(frameworkDependentPropertyName));
parameters.put(ActionConstants.PARM_PROP_NAME, frameworkDependentPropertyName);
parameters.put(ActionConstants.PARM_PROP_VALUE, frameworkDependentPropertyValue);
parameters = Collections.unmodifiableMap(parameters);
SetProgramPropertyAction action = new SetProgramPropertyAction();
action.execute(parameters);
- assertEquals("true", manipulator.getConfigData().getFwDependentProp(frameworkDependentPropertyName));
+ assertEquals("true", manipulator.getConfigData().getProperty(frameworkDependentPropertyName));
action.undo(parameters);
- assertFalse(manipulator.getConfigData().getFwDependentProps().containsKey(frameworkDependentPropertyName));
+ assertFalse(manipulator.getConfigData().getProperties().containsKey(frameworkDependentPropertyName));
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java
index e34957de9..40640360d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.util.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util;
@@ -83,8 +84,8 @@ public class SetStartLevelActionTest extends AbstractProvisioningTest {
assertTrue(isStartLevel(manipulator, osgiTarget, -1));
}
- private boolean isStartLevel(Manipulator manipulator, File osgiTarget, int startLevel) throws IOException {
- String location = osgiTarget.toURL().toExternalForm();
+ private boolean isStartLevel(Manipulator manipulator, File osgiTarget, int startLevel) {
+ URI location = osgiTarget.toURI();
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (location.equals(bundles[i].getLocation()) && (startLevel == bundles[i].getStartLevel()))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java
index 13cff5345..c3d72e62c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java
@@ -10,6 +10,7 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.util.*;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util;
@@ -82,8 +83,8 @@ public class UninstallBundleActionTest extends AbstractProvisioningTest {
assertTrue(inBundles(manipulator, osgiTarget));
}
- private boolean inBundles(Manipulator manipulator, File osgiTarget) throws IOException {
- String location = osgiTarget.toURL().toExternalForm();
+ private boolean inBundles(Manipulator manipulator, File osgiTarget) {
+ URI location = osgiTarget.toURI();
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (location.equals(bundles[i].getLocation()))

Back to the top