Search in sources :

Example 1 with BeforeExecutionExclusionFileFilter

use of com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter 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());
}
Also used : BeforeExecutionExclusionFileFilter(com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter) BeforeExecutionFileFilterSet(com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet) Test(org.junit.Test)

Example 2 with BeforeExecutionExclusionFileFilter

use of com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter 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"));
}
Also used : BeforeExecutionExclusionFileFilter(com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter) BeforeExecutionFileFilterSet(com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet) Test(org.junit.Test)

Example 3 with BeforeExecutionExclusionFileFilter

use of com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter 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());
}
Also used : BeforeExecutionExclusionFileFilter(com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter) BeforeExecutionFileFilterSet(com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet) Test(org.junit.Test)

Example 4 with BeforeExecutionExclusionFileFilter

use of com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter 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"));
}
Also used : BeforeExecutionExclusionFileFilter(com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter) BeforeExecutionFileFilterSet(com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet) Test(org.junit.Test)

Aggregations

BeforeExecutionFileFilterSet (com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilterSet)4 BeforeExecutionExclusionFileFilter (com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter)4 Test (org.junit.Test)4