|
|
@@ -6,6 +6,7 @@
|
|
|
*/
|
|
|
package net.ranides.assira.io;
|
|
|
|
|
|
+import net.ranides.assira.trace.LoggerUtils;
|
|
|
import org.junit.Test;
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
@@ -19,9 +20,21 @@ public class PathHelperTest {
|
|
|
public PathHelperTest() {
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testExtension() throws PathConvertException {
|
|
|
+ assertEquals(".txt", PathHelper.getExtension("file.txt"));
|
|
|
+ assertEquals(".txt", PathHelper.getExtension("\\base\\file.txt"));
|
|
|
+ assertEquals(".txt", PathHelper.getExtension("/base/file.txt"));
|
|
|
+ assertEquals(".txt", PathHelper.getExtension("/base/file.log.txt"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Test
|
|
|
public void testRelative() throws PathConvertException {
|
|
|
|
|
|
+ assertEquals("..\\..\\temp", PathHelper.asRelative("base/home/system/drivers", "base/home/temp"));
|
|
|
+
|
|
|
+
|
|
|
assertEquals("..\\..\\temp", PathHelper.asRelative("base\\home\\system\\drivers", "base\\home\\temp"));
|
|
|
|
|
|
assertEquals("..\\..\\temp\\data\\int\\value", PathHelper.asRelative("base\\home\\system\\drivers", "base\\home\\temp\\data\\int\\value"));
|