Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2009-02-20 22:47:51 +0000
committerDJ Houghton2009-02-20 22:47:51 +0000
commit0572acab24bca9bc1917fe3a0d1d3b67e8ea4d55 (patch)
tree4abbaba976873e012772c71e37e4af2bb00488d6 /bundles/org.eclipse.equinox.frameworkadmin.test
parent82de88aed4ba693f08a99509f6d366e11110cdf4 (diff)
downloadrt.equinox.p2-0572acab24bca9bc1917fe3a0d1d3b67e8ea4d55.tar.gz
rt.equinox.p2-0572acab24bca9bc1917fe3a0d1d3b67e8ea4d55.tar.xz
rt.equinox.p2-0572acab24bca9bc1917fe3a0d1d3b67e8ea4d55.zip
Fix platform-specific test failures.
Diffstat (limited to 'bundles/org.eclipse.equinox.frameworkadmin.test')
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java40
1 files changed, 28 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java
index d07dec7c0..ab7f5a71a 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java
@@ -19,6 +19,9 @@ import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImp
import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
public class RelativePathTest extends FwkAdminAndSimpleConfiguratorTest {
+ /** Constant value indicating if the current platform is Windows */
+ private static final boolean WINDOWS = java.io.File.separatorChar == '\\';
+
public RelativePathTest(String name) throws Exception {
super(name);
}
@@ -89,25 +92,38 @@ public class RelativePathTest extends FwkAdminAndSimpleConfiguratorTest {
public void testMakeRelative() {
URL base = null;
try {
- base = new URL("file:/c:/a/eclipse/");
+ base = new URL("file:/eclipse/");
} catch (MalformedURLException e) {
e.printStackTrace();
- fail("0.99");
+ fail("0.98");
}
// data - [0] is the test data and [1] is the expected result
String[][] data = new String[][] { //
- new String[] {"file:c:/b/shared/plugins/bar.jar", "file:../../b/shared/plugins/bar.jar"}, //
- new String[] {"file:d:/b/shared/plugins/bar.jar", "file:d:/b/shared/plugins/bar.jar"}, //
- new String[] {"file:/c:/a/eclipse/plugins/bar.jar", "file:plugins/bar.jar"}, //
- new String[] {"file:c:/a/eclipse/plugins/bar.jar", "file:plugins/bar.jar"}, //
- new String[] {"file:/c:/a/shared/plugins/bar.jar", "file:../shared/plugins/bar.jar"}, //
- new String[] {"file:/d:/a/eclipse/plugins/bar.jar", "file:/d:/a/eclipse/plugins/bar.jar"}, //
- new String[] {"file:/c:/x/eclipse/plugins/bar.jar", "file:../../x/eclipse/plugins/bar.jar"}, //
- new String[] {"file://home/eclipse/foo.jar", "file://home/eclipse/foo.jar"}, //
- new String[] {"file:///home/eclipse/foo.jar", "file:///home/eclipse/foo.jar"}, //
+ new String[] {"file:/home/eclipse/foo.jar", "file:../home/eclipse/foo.jar"}, //
+ new String[] {"file:///home/eclipse/foo.jar", "file:../home/eclipse/foo.jar"}, //
};
- for (int i = 0; i < data.length; i++) {
+ for (int i = 0; i < data.length; i++)
assertEquals("1." + i, data[i][1], EquinoxManipulatorImpl.makeRelative(data[i][0], base));
+
+ if (WINDOWS) {
+ // platform specific data
+ try {
+ base = new URL("file:/c:/a/eclipse/");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ fail("0.99");
+ }
+ data = new String[][] {
+ new String[] {"file:c:/b/shared/plugins/bar.jar", "file:../../b/shared/plugins/bar.jar"}, //
+ new String[] {"file:d:/b/shared/plugins/bar.jar", "file:d:/b/shared/plugins/bar.jar"}, //
+ new String[] {"file:/c:/a/eclipse/plugins/bar.jar", "file:plugins/bar.jar"}, //
+ new String[] {"file:c:/a/eclipse/plugins/bar.jar", "file:plugins/bar.jar"}, //
+ new String[] {"file:/c:/a/shared/plugins/bar.jar", "file:../shared/plugins/bar.jar"}, //
+ new String[] {"file:/d:/a/eclipse/plugins/bar.jar", "file:/d:/a/eclipse/plugins/bar.jar"}, //
+ new String[] {"file:/c:/x/eclipse/plugins/bar.jar", "file:../../x/eclipse/plugins/bar.jar"}, //
+ };
+ for (int i = 0; i < data.length; i++)
+ assertEquals("2." + i, data[i][1], EquinoxManipulatorImpl.makeRelative(data[i][0], base));
}
}

Back to the top