Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-10-10 20:18:17 +0000
committerSimon Kaegi2008-10-10 20:18:17 +0000
commit87743d42019afc0342bc4a4eafd0825f36b7d95c (patch)
treed69091a0781754ca9a0bdcfeb7c2bef01c9fd8ae /bundles/org.eclipse.equinox.p2.tests/src
parent68d3e0c89ae1859b95fcf112fccbb5247bbf71bc (diff)
downloadrt.equinox.p2-87743d42019afc0342bc4a4eafd0825f36b7d95c.tar.gz
rt.equinox.p2-87743d42019afc0342bc4a4eafd0825f36b7d95c.tar.xz
rt.equinox.p2-87743d42019afc0342bc4a4eafd0825f36b7d95c.zip
adding a file based removeFileExtension test
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/URIUtilTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/URIUtilTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/URIUtilTest.java
index 929e741a7..725973f9a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/URIUtilTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/URIUtilTest.java
@@ -125,4 +125,14 @@ public class URIUtilTest extends AbstractProvisioningTest {
fail("URI syntax exception", e);
}
}
+
+ public void testRemoveFileExtensionFromFile() throws URISyntaxException {
+ String fileName = "/c:/some.dir/afile";
+ File testFileWithExtension = new File(fileName + ".extension");
+ File testFileWithOutExtension = new File(fileName);
+ URI correctURI = testFileWithOutExtension.toURI();
+
+ assertEquals(correctURI, URIUtil.removeFileExtension(testFileWithExtension.toURI()));
+ assertEquals(correctURI, URIUtil.removeFileExtension(testFileWithOutExtension.toURI()));
+ }
}

Back to the top