use of org.sonar.api.batch.fs.FilePredicate in project sonarqube by SonarSource.
the class AndPredicateTest method simplifyAndExpressionsWhenEmpty.
@Test
public void simplifyAndExpressionsWhenEmpty() {
FilePredicate andPredicate = AndPredicate.create(Arrays.<FilePredicate>asList());
assertThat(andPredicate).isEqualTo(TruePredicate.TRUE);
}
use of org.sonar.api.batch.fs.FilePredicate in project sonarqube by SonarSource.
the class OrPredicateTest method simplifyOrExpressionsWhenFalse.
@Test
public void simplifyOrExpressionsWhenFalse() {
PathPatternPredicate pathPatternPredicate1 = new PathPatternPredicate(PathPattern.create("foo1/**"));
PathPatternPredicate pathPatternPredicate2 = new PathPatternPredicate(PathPattern.create("foo2/**"));
FilePredicate andPredicate = OrPredicate.create(Arrays.<FilePredicate>asList(pathPatternPredicate1, FalsePredicate.FALSE, pathPatternPredicate2));
assertThat(((OrPredicate) andPredicate).predicates()).containsExactly(pathPatternPredicate1, pathPatternPredicate2);
}
use of org.sonar.api.batch.fs.FilePredicate in project sonarqube by SonarSource.
the class OrPredicateTest method flattenNestedOr.
@Test
public void flattenNestedOr() {
PathPatternPredicate pathPatternPredicate1 = new PathPatternPredicate(PathPattern.create("foo1/**"));
PathPatternPredicate pathPatternPredicate2 = new PathPatternPredicate(PathPattern.create("foo2/**"));
PathPatternPredicate pathPatternPredicate3 = new PathPatternPredicate(PathPattern.create("foo3/**"));
FilePredicate orPredicate = OrPredicate.create(Arrays.<FilePredicate>asList(pathPatternPredicate1, OrPredicate.create(Arrays.<FilePredicate>asList(pathPatternPredicate2, pathPatternPredicate3))));
assertThat(((OrPredicate) orPredicate).predicates()).containsExactly(pathPatternPredicate1, pathPatternPredicate2, pathPatternPredicate3);
}
use of org.sonar.api.batch.fs.FilePredicate in project sonarqube by SonarSource.
the class OrPredicateTest method simplifyOrExpressionsWhenEmpty.
@Test
public void simplifyOrExpressionsWhenEmpty() {
FilePredicate orPredicate = OrPredicate.create(Arrays.<FilePredicate>asList());
assertThat(orPredicate).isEqualTo(TruePredicate.TRUE);
}
Aggregations