Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-03-04 17:14:01 +0000
committerAndrew Niefer2010-03-04 17:14:01 +0000
commitcff731b720117eb7d1e904d8428d4063954671b0 (patch)
tree1fbc6ceccce761ee7795b3e77d4e272b720667fc /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator
parentb3dc20c2956fc21fcd933d8b11053f2d2585c7f8 (diff)
downloadrt.equinox.p2-cff731b720117eb7d1e904d8428d4063954671b0.tar.gz
rt.equinox.p2-cff731b720117eb7d1e904d8428d4063954671b0.tar.xz
rt.equinox.p2-cff731b720117eb7d1e904d8428d4063954671b0.zip
bug 269496 - SimpleConfiguratorManipulator api
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/manipulator/SimpleConfiguratorManipulatorTests.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorTests.java
index a247c8809..bf5d9f401 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorTests.java
@@ -12,11 +12,13 @@
package org.eclipse.equinox.p2.tests.simpleconfigurator.manipulator;
import java.io.File;
+import java.io.FileInputStream;
import java.net.URI;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
-import org.eclipse.equinox.internal.provisional.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
+import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.simpleconfigurator.manipulator.SimpleConfiguratorManipulatorImpl;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.URIUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+import org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
public class SimpleConfiguratorManipulatorTests extends AbstractProvisioningTest {
@@ -24,26 +26,26 @@ public class SimpleConfiguratorManipulatorTests extends AbstractProvisioningTest
File folder = getTestFolder("saveConfiguration");
File infoFile = new File(folder, "bundle.info");
- File baseFile = getTempFolder();
+ URI baseFile = getTempFolder().toURI();
//absolute location written with base
BundleInfo[] bundles = new BundleInfo[] {new BundleInfo("a", "1.0.0", new File(folder, "plugins/a_1.0.0.jar").toURI(), BundleInfo.NO_LEVEL, false)};
SimpleConfiguratorManipulator manipulator = new SimpleConfiguratorManipulatorImpl();
- manipulator.saveConfiguration(bundles, infoFile, folder);
- bundles = manipulator.loadConfiguration(infoFile.toURL(), baseFile);
- assertEquals(bundles[0].getLocation(), new File(baseFile, "plugins/a_1.0.0.jar").toURI());
+ manipulator.saveConfiguration(bundles, infoFile, folder.toURI());
+ bundles = manipulator.loadConfiguration(new FileInputStream(infoFile), baseFile);
+ assertEquals(bundles[0].getLocation(), URIUtil.append(baseFile, "plugins/a_1.0.0.jar"));
//relative location written with null base
bundles = new BundleInfo[] {new BundleInfo("b", "1.0.0", new URI("plugins/b_1.0.0.jar"), BundleInfo.NO_LEVEL, false)};
manipulator.saveConfiguration(bundles, infoFile, null);
- bundles = manipulator.loadConfiguration(infoFile.toURL(), baseFile);
- assertEquals(bundles[0].getLocation(), new File(baseFile, "plugins/b_1.0.0.jar").toURI());
+ bundles = manipulator.loadConfiguration(new FileInputStream(infoFile), baseFile);
+ assertEquals(bundles[0].getLocation(), URIUtil.append(baseFile, "plugins/b_1.0.0.jar"));
//absolute location written with null base
URI absolute = new File(folder, "plugins/c_1.0.0.jar").toURI();
bundles = new BundleInfo[] {new BundleInfo("c", "1.0.0", absolute, BundleInfo.NO_LEVEL, false)};
manipulator.saveConfiguration(bundles, infoFile, null);
- bundles = manipulator.loadConfiguration(infoFile.toURL(), baseFile);
+ bundles = manipulator.loadConfiguration(new FileInputStream(infoFile), baseFile);
assertEquals(bundles[0].getLocation(), absolute);
}
}

Back to the top