@Test public void testPatternAppliedToSourceFilesOnly() throws Exception { Path src = root.resolve("src"); test1 = src.resolve("FirstTest.java"); Path test2 = src.resolve("SecondTest.java"); Path externalTest = root.resolve("ExternalTest.java"); Files.createDirectories(src); Files.createFile(test1); Files.createFile(test2); Files.createFile(externalTest); fileFinder = new InputFileFinder("src/**", "*Test.*", null, Charset.defaultCharset()); List<ClientInputFile> files = fileFinder.collect(root); assertThat(files).extracting("path").containsOnly(test1.toString(), test2.toString(), src1.toString()); }
public List<ClientInputFile> collect(Path dir) throws IOException { final List<ClientInputFile> files = new ArrayList<>(); Files.walkFileTree(dir, new FileCollector(dir, files)); return files; }
InputFileFinder { public List<ClientInputFile> collect(Path dir) throws IOException { final List<ClientInputFile> files = new ArrayList<>(); Files.walkFileTree(dir, new FileCollector(dir, files)); return files; } }
InputFileFinder { public List<ClientInputFile> collect(Path dir) throws IOException { final List<ClientInputFile> files = new ArrayList<>(); Files.walkFileTree(dir, new FileCollector(dir, files)); return files; } InputFileFinder(@Nullable String srcGlobPattern, @Nullable String testsGlobPattern, @Nullable String excludeGlobPattern, Charset charset); }
InputFileFinder { public List<ClientInputFile> collect(Path dir) throws IOException { final List<ClientInputFile> files = new ArrayList<>(); Files.walkFileTree(dir, new FileCollector(dir, files)); return files; } InputFileFinder(@Nullable String srcGlobPattern, @Nullable String testsGlobPattern, @Nullable String excludeGlobPattern, Charset charset); List<ClientInputFile> collect(Path dir); }
InputFileFinder { public List<ClientInputFile> collect(Path dir) throws IOException { final List<ClientInputFile> files = new ArrayList<>(); Files.walkFileTree(dir, new FileCollector(dir, files)); return files; } InputFileFinder(@Nullable String srcGlobPattern, @Nullable String testsGlobPattern, @Nullable String excludeGlobPattern, Charset charset); List<ClientInputFile> collect(Path dir); static final String GLOB_PREFIX; }