X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.jcr%2Fext%2Ftest%2Forg%2Fargeo%2Fjcr%2Ffs%2FJcrFileSystemTest.java;fp=org.argeo.jcr%2Fext%2Ftest%2Forg%2Fargeo%2Fjcr%2Ffs%2FJcrFileSystemTest.java;h=2ad75a2aa2fceee280106182428e1427f988a5ca;hb=846e51f6df6b29222d5d83372705cb694db22ad7;hp=1cf7ef70e9573e0a4c99e91c2d59175eaea50026;hpb=7cf338533865594652b72a81bdba5472745ce034;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.jcr/ext/test/org/argeo/jcr/fs/JcrFileSystemTest.java b/org.argeo.jcr/ext/test/org/argeo/jcr/fs/JcrFileSystemTest.java index 1cf7ef70e..2ad75a2aa 100644 --- a/org.argeo.jcr/ext/test/org/argeo/jcr/fs/JcrFileSystemTest.java +++ b/org.argeo.jcr/ext/test/org/argeo/jcr/fs/JcrFileSystemTest.java @@ -29,7 +29,18 @@ public class JcrFileSystemTest extends TestCase { FileSystemProvider fsProvider = new JackrabbitMemoryFsProvider(); // Simple file + Path rootPath = fsProvider.getPath(new URI("jcr+memory:/")); + log.debug("Got root " + rootPath); Path testPath = fsProvider.getPath(new URI("jcr+memory:/test.txt")); + log.debug("Test path"); + assertEquals("test.txt", testPath.getFileName().toString()); + assertEquals(rootPath, testPath.getParent()); + assertEquals(testPath.getFileName(), rootPath.relativize(testPath)); + // relativize self should be empty path + Path selfRelative = testPath.relativize(testPath); + assertEquals("", selfRelative.toString()); + + log.debug("Create file " + testPath); Files.createFile(testPath); BasicFileAttributes bfa = Files.readAttributes(testPath, BasicFileAttributes.class); FileTime ft = bfa.creationTime(); @@ -46,8 +57,6 @@ public class JcrFileSystemTest extends TestCase { assertTrue(Arrays.equals(arr, read)); assertEquals(txt, new String(read)); log.debug("Read " + testPath); - Path rootPath = fsProvider.getPath(new URI("jcr+memory:/")); - log.debug("Got root " + rootPath); Path testDir = rootPath.resolve("testDir"); log.debug("Resolved " + testDir); // Copy