@Test public void testGetParent() throws Exception { assertEquals("/path/to/some", fragment.getParent(somePath).getPath()); // Self assertEquals(fragment.getRoot().getPath(), fragment.getParent(new File("/path")).getPath()); assertEquals(fragment.getRoot().getPath(), fragment.getParent(new File("/")).getPath()); }
@Test public void testCompareFiles() throws Exception { assertEquals(0, fragment.compareFiles(new File("/A/A"), new File("/A/A"))); assertEquals(-1, fragment.compareFiles(new File("/A/A"), new File("/A/B"))); assertEquals(1, fragment.compareFiles(new File("/A/B"), new File("/A/A"))); // Dir is assumed to be the same assertEquals(1, fragment.compareFiles(new File("/A/B"), new File("/B/A"))); assertEquals(-1, fragment.compareFiles(new File("/B/A"), new File("/A/B"))); assertEquals(0, fragment.compareFiles(new File("/A/B"), new File("/B/B"))); }
@Test public void testGetRoot() throws Exception { assertEquals("/", fragment.getRoot().getPath()); }
@Test public void testGetFullPath() throws Exception { assertEquals("/some/path", fragment.getFullPath(new File("/some/path"))); }
@Test public void testGetPath() throws Exception { assertEquals("/some/path", fragment.getPath("/some/path").getPath()); }
@Test public void testGetName() throws Exception { assertEquals(someName, fragment.getName(somePath)); }