JaCoCoConfiguration { public boolean shouldExecuteOnProject(boolean reportFound) { return hasGroovyFiles() && (reportFound || isCoverageToZeroWhenNoReport()); } JaCoCoConfiguration(Settings settings, FileSystem fileSystem); boolean shouldExecuteOnProject(boolean reportFound); String getReportPath(); String getItReportPath(); static List<PropertyDefinition> getPropertyDefinitions(); static final String REPORT_PATH_PROPERTY; static final String REPORT_PATH_DEFAULT_VALUE; static final String IT_REPORT_PATH_PROPERTY; static final String IT_REPORT_PATH_DEFAULT_VALUE; static final String REPORT_MISSING_FORCE_ZERO; static final boolean REPORT_MISSING_FORCE_ZERO_DEFAULT_VALUE; }
@Test public void shouldExecuteOnProject() throws Exception { assertThat(jacocoSettings.shouldExecuteOnProject(true)).isFalse(); assertThat(jacocoSettings.shouldExecuteOnProject(false)).isFalse(); fileSystem.add(new DefaultInputFile("", "src/foo/bar.java").setLanguage("java")); assertThat(jacocoSettings.shouldExecuteOnProject(true)).isFalse(); assertThat(jacocoSettings.shouldExecuteOnProject(false)).isFalse(); fileSystem.add(new DefaultInputFile("", "src/foo/bar.groovy").setLanguage(Groovy.KEY)); assertThat(jacocoSettings.shouldExecuteOnProject(true)).isTrue(); assertThat(jacocoSettings.shouldExecuteOnProject(false)).isFalse(); settings.setProperty(JaCoCoConfiguration.REPORT_MISSING_FORCE_ZERO, true); assertThat(jacocoSettings.shouldExecuteOnProject(true)).isTrue(); assertThat(jacocoSettings.shouldExecuteOnProject(false)).isTrue(); }