IncludeValidationHelper { public void checkSourceIncludesExist(MavenProject project, BuildProperties buildProperties, boolean strict) throws MojoExecutionException { checkIncludesExist("src.includes", buildProperties.getSourceIncludes(), project, strict); } IncludeValidationHelper();  IncludeValidationHelper(Logger log); void checkBinIncludesExist(MavenProject project, BuildProperties buildProperties, boolean strict,
            String... ignoredIncludes); void checkSourceIncludesExist(MavenProject project, BuildProperties buildProperties, boolean strict);  }
@Test public void testCheckSourceIncludesExistAntPatterns() throws Exception { BuildPropertiesImpl buildProperties = createBuildProperties("src.includes", "foo.txt, bar*,**/*.me"); subject.checkSourceIncludesExist(createMockProject(), buildProperties, true); }
@Test public void testCheckSourceIncludesDontExist() throws Exception { BuildPropertiesImpl buildProperties = createBuildProperties("src.includes", "foo3, bar3*,**/*.me"); try { subject.checkSourceIncludesExist(createMockProject(), buildProperties, true); fail(); } catch (MojoExecutionException e) { assertStringContains("src.includes value(s) [foo3, bar3*] do not match any files.", e.getMessage()); } }
@Test public void testWarning() throws Exception { final List<String> warnings = new ArrayList<>(); Logger log = new AbstractLogger(Logger.LEVEL_DEBUG, null) { @Override public void warn(String message, Throwable throwable) { warnings.add(message); } @Override public void info(String message, Throwable throwable) { fail(); } @Override public Logger getChildLogger(String name) { return null; } @Override public void fatalError(String message, Throwable throwable) { fail(); } @Override public void error(String message, Throwable throwable) { fail(); } @Override public void debug(String message, Throwable throwable) { fail(); } }; IncludeValidationHelper subject = new IncludeValidationHelper(log); BuildPropertiesImpl buildProperties = createBuildProperties("src.includes", "foo3, bar3*,**/*.me"); MavenProject project = createMockProject(); subject.checkSourceIncludesExist(project, buildProperties, false); assertEquals(1, warnings.size()); assertEquals(new File(project.getBasedir(), "build.properties").getAbsolutePath() + ": src.includes value(s) [foo3, bar3*] do not match any files.", warnings.get(0)); }