use of com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet in project checkstyle by checkstyle.
the class BeforeExecutionFileFilterSetTest method testGetFilters2.
@Test
public void testGetFilters2() {
final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet();
filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter());
assertEquals("size is the same", 1, filterSet.getBeforeExecutionFileFilters().size());
}
use of com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet in project checkstyle by checkstyle.
the class BeforeExecutionFileFilterSetTest method testAccept.
@Test
public void testAccept() {
final String fileName = "BAD";
final BeforeExecutionExclusionFileFilter filter = new BeforeExecutionExclusionFileFilter();
filter.setFileNamePattern(Pattern.compile(fileName));
final BeforeExecutionFileFilterSet set = new BeforeExecutionFileFilterSet();
set.addBeforeExecutionFileFilter(filter);
assertTrue(set.accept("ATest.java"));
}
use of com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet in project checkstyle by checkstyle.
the class BeforeExecutionFileFilterSetTest method testToString2.
@Test
public void testToString2() {
final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet();
filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter());
assertNotNull("size is the same", filterSet.toString());
}
use of com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet in project checkstyle by checkstyle.
the class BeforeExecutionFileFilterSetTest method testReject.
@Test
public void testReject() {
final String fileName = "Test";
final BeforeExecutionExclusionFileFilter filter = new BeforeExecutionExclusionFileFilter();
filter.setFileNamePattern(Pattern.compile(fileName));
final BeforeExecutionFileFilterSet set = new BeforeExecutionFileFilterSet();
set.addBeforeExecutionFileFilter(filter);
assertFalse(set.accept("ATest.java"));
}
Aggregations