use of org.sonar.scanner.scan.filesystem.ModuleCoverageAndDuplicationExclusions in project sonarqube by SonarSource.
the class ModuleCoverageAndDuplicationExclusionsTest method shouldNotExcludeFileBasedOnPattern.
@Test
public void shouldNotExcludeFileBasedOnPattern() {
DefaultInputFile file = TestInputFileBuilder.create("foo", new File(baseDir, "moduleA"), new File(baseDir, "moduleA/src/org/polop/File.php")).setProjectBaseDir(baseDir.toPath()).build();
coverageExclusions = new ModuleCoverageAndDuplicationExclusions(mockConfig("src/org/other/*", ""));
assertThat(coverageExclusions.isExcludedForCoverage(file)).isFalse();
}
use of org.sonar.scanner.scan.filesystem.ModuleCoverageAndDuplicationExclusions in project sonarqube by SonarSource.
the class ModuleCoverageAndDuplicationExclusionsTest method shouldExcludeFileBasedOnPattern.
@Test
public void shouldExcludeFileBasedOnPattern() {
DefaultInputFile file = TestInputFileBuilder.create("foo", new File(baseDir, "moduleA"), new File(baseDir, "moduleA/src/org/polop/File.php")).setProjectBaseDir(baseDir.toPath()).build();
coverageExclusions = new ModuleCoverageAndDuplicationExclusions(mockConfig("src/org/polop/*", ""));
assertThat(coverageExclusions.isExcludedForCoverage(file)).isTrue();
}
Aggregations