assertThat(fs, notNullValue()); assertThat(fs.getRoot(), notNullValue()); Iterable<SCMFile> children = fs.getRoot().children(); Iterator<SCMFile> iterator = children.iterator(); assertThat(iterator.hasNext(), is(true)); assertThat(dir.getName(), is("dir")); assertThat(dir.getType(), is(SCMFile.Type.DIRECTORY)); children = dir.children(); iterator = children.iterator(); assertThat(iterator.hasNext(), is(true)); assertThat(subdir.getName(), is("subdir")); assertThat(subdir.getType(), is(SCMFile.Type.DIRECTORY)); children = subdir.children(); iterator = children.iterator(); assertThat(iterator.hasNext(), is(true));
@Test public void ofSourceRevision() throws Exception { sampleRepo.init(); sampleRepo.svnkit("copy", "--message=branching", sampleRepo.trunkUrl(), sampleRepo.branchesUrl() + "/dev"); sampleRepo.svnkit("switch", sampleRepo.branchesUrl() + "/dev", sampleRepo.wc()); SCMSource source = new SubversionSCMSource(null, sampleRepo.prjUrl()); SCMRevision revision = source.fetch(new SCMHead("branches/dev"), null); sampleRepo.write("file", "modified"); sampleRepo.svnkit("commit", "--message=dev1", sampleRepo.wc()); try (SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("branches/dev"), revision)) { assertThat(fs, notNullValue()); SCMFile root = fs.getRoot(); assertThat(root, notNullValue()); Iterable<SCMFile> children = root.children(); Iterator<SCMFile> iterator = children.iterator(); assertThat(iterator.hasNext(), is(true)); SCMFile file = iterator.next(); assertThat(iterator.hasNext(), is(false)); assertThat(file.getName(), is("file")); assertThat(file.contentAsString(), is("")); } }
assertThat(fs, notNullValue()); assertThat(fs.getRoot(), notNullValue()); Iterable<SCMFile> children = fs.getRoot().children(); Set<String> names = new TreeSet<String>(); SCMFile file = null;
assertThat(root, notNullValue()); assertTrue(root.isRoot()); Iterable<SCMFile> children = root.children(); Iterator<SCMFile> iterator = children.iterator(); assertThat(iterator.hasNext(), is(true));