@Test public void givenAJavaccInputFileWhenVisitFileThenFileIsNotCopiedToTaskOutputDirectory() { FileVisitDetails fileDetails = mock(FileVisitDetails.class); when(fileDetails.getFile()).thenReturn(new File(inputDirectory, JAVACC_INPUT_FILENAME)); when(fileDetails.getName()).thenReturn(JAVACC_INPUT_FILENAME); sourceVisitor.visitFile(fileDetails); assertEquals(0, outputDirectory.list().length); }
@Override public void visitFile(FileVisitDetails fileDetails) { if (!isValidSourceFileForTask(fileDetails)) { File sourceFile = fileDetails.getFile(); File destinationFile = new File(sourceFile.getAbsolutePath().replace(compiler.getInputDirectory().getAbsolutePath(), compiler.getOutputDirectory().getAbsolutePath())); copyFile(sourceFile, destinationFile); } }
NonJavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (!isValidSourceFileForTask(fileDetails)) { File sourceFile = fileDetails.getFile(); File destinationFile = new File(sourceFile.getAbsolutePath().replace(compiler.getInputDirectory().getAbsolutePath(), compiler.getOutputDirectory().getAbsolutePath())); copyFile(sourceFile, destinationFile); } } }
NonJavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (!isValidSourceFileForTask(fileDetails)) { File sourceFile = fileDetails.getFile(); File destinationFile = new File(sourceFile.getAbsolutePath().replace(compiler.getInputDirectory().getAbsolutePath(), compiler.getOutputDirectory().getAbsolutePath())); copyFile(sourceFile, destinationFile); } } NonJavaccSourceFileVisitor(SourceFileCompiler compiler); }
NonJavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (!isValidSourceFileForTask(fileDetails)) { File sourceFile = fileDetails.getFile(); File destinationFile = new File(sourceFile.getAbsolutePath().replace(compiler.getInputDirectory().getAbsolutePath(), compiler.getOutputDirectory().getAbsolutePath())); copyFile(sourceFile, destinationFile); } } NonJavaccSourceFileVisitor(SourceFileCompiler compiler); @Override void visitFile(FileVisitDetails fileDetails); }
NonJavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (!isValidSourceFileForTask(fileDetails)) { File sourceFile = fileDetails.getFile(); File destinationFile = new File(sourceFile.getAbsolutePath().replace(compiler.getInputDirectory().getAbsolutePath(), compiler.getOutputDirectory().getAbsolutePath())); copyFile(sourceFile, destinationFile); } } NonJavaccSourceFileVisitor(SourceFileCompiler compiler); @Override void visitFile(FileVisitDetails fileDetails);  }