X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.jcr%2Fext%2Ftest%2Forg%2Fargeo%2Fjcr%2Ffs%2FJcrFileSystemTest.java;h=2d03b8f2c22c338f65dd0386ae71ee2c9fca5eb8;hb=2afabd9e7b225f80b341063e25188314394c9aef;hp=886efa3675450c7c14faf7c1fc1346bdcc7a4078;hpb=6d8432bcf931c7525ecc4254b2a95e8a413a06f1;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 886efa367..2d03b8f2c 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 @@ -42,6 +42,8 @@ public class JcrFileSystemTest extends TestCase { Path rootPath = fsProvider.getPath(new URI("jcr+memory:/")); log.debug("Got root " + rootPath); + Path testDir = rootPath.resolve("testDir"); + Files.createDirectory(testDir); Path testMount = fsProvider.getPath(new URI("jcr+memory:/test")); log.debug("Test path"); @@ -58,6 +60,31 @@ public class JcrFileSystemTest extends TestCase { log.debug("Created " + testPath + " (" + ft + ")"); Files.delete(testPath); log.debug("Deleted " + testPath); + + // Browse directories from root + DirectoryStream files = Files.newDirectoryStream(rootPath); + int directoryCount = 0; + for (Path file : files) { + if (Files.isDirectory(file)) { + directoryCount++; + } + } + assertEquals(2, directoryCount); + + // Browse directories from mount + Path mountSubDir = testMount.resolve("mountSubDir"); + Files.createDirectory(mountSubDir); + Path otherSubDir = testMount.resolve("otherSubDir"); + Files.createDirectory(otherSubDir); + testPath = testMount.resolve("test.txt"); + Files.createFile(testPath); + files = Files.newDirectoryStream(testMount); + int fileCount = 0; + for (Path file : files) { + fileCount++; + } + assertEquals(3, fileCount); + } public void testSimple() throws Exception {