Search in sources :

Example 16 with FilterBuilder

use of org.reflections.util.FilterBuilder in project reflections by ronmamo.

the class FilterBuilderTest method test_parsePackages_exclude.

@Test
public void test_parsePackages_exclude() {
    FilterBuilder filter = FilterBuilder.parsePackages("-org.reflections");
    assertFalse(filter.apply("org.reflections.Reflections"));
    assertFalse(filter.apply("org.reflections.foo.Reflections"));
    assertTrue(filter.apply("org.foobar.Reflections"));
    assertTrue(filter.apply("org.reflectionsplus.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Example 17 with FilterBuilder

use of org.reflections.util.FilterBuilder in project reflections by ronmamo.

the class FilterBuilderTest method test_parse_exclude_notRegex.

@Test
public void test_parse_exclude_notRegex() {
    FilterBuilder filter = FilterBuilder.parse("-org.reflections");
    assertTrue(filter.apply("org.reflections.Reflections"));
    assertTrue(filter.apply("org.reflections.foo.Reflections"));
    assertTrue(filter.apply("org.foobar.Reflections"));
    assertTrue(filter.apply("org.reflectionsplus.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Example 18 with FilterBuilder

use of org.reflections.util.FilterBuilder in project reflections by ronmamo.

the class FilterBuilderTest method test_parsePackages_exclude_trailingDot.

@Test
public void test_parsePackages_exclude_trailingDot() {
    FilterBuilder filter = FilterBuilder.parsePackages("-org.reflections.");
    assertFalse(filter.apply("org.reflections.Reflections"));
    assertFalse(filter.apply("org.reflections.foo.Reflections"));
    assertTrue(filter.apply("org.foobar.Reflections"));
    assertTrue(filter.apply("org.reflectionsplus.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Example 19 with FilterBuilder

use of org.reflections.util.FilterBuilder in project reflections by ronmamo.

the class FilterBuilderTest method test_parsePackages_include.

//-----------------------------------------------------------------------
@Test
public void test_parsePackages_include() {
    FilterBuilder filter = FilterBuilder.parsePackages("+org.reflections");
    assertTrue(filter.apply("org.reflections.Reflections"));
    assertTrue(filter.apply("org.reflections.foo.Reflections"));
    assertFalse(filter.apply("org.foobar.Reflections"));
    assertFalse(filter.apply("org.reflectionsplus.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Example 20 with FilterBuilder

use of org.reflections.util.FilterBuilder in project reflections by ronmamo.

the class FilterBuilderTest method test_parse_exclude.

@Test
public void test_parse_exclude() {
    FilterBuilder filter = FilterBuilder.parse("-org.reflections.*");
    assertFalse(filter.apply("org.reflections.Reflections"));
    assertFalse(filter.apply("org.reflections.foo.Reflections"));
    assertTrue(filter.apply("org.foobar.Reflections"));
    assertFalse(filter.apply("org.reflectionsplus.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Aggregations

FilterBuilder (org.reflections.util.FilterBuilder)25 Test (org.junit.Test)17 ConfigurationBuilder (org.reflections.util.ConfigurationBuilder)7 Reflections (org.reflections.Reflections)5 ArrayList (java.util.ArrayList)3 SubTypesScanner (org.reflections.scanners.SubTypesScanner)3 URL (java.net.URL)2 HashSet (java.util.HashSet)2 BeforeClass (org.junit.BeforeClass)2 Stopwatch (com.google.common.base.Stopwatch)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 UtilityClass (lombok.experimental.UtilityClass)1 Slf4j (lombok.extern.slf4j.Slf4j)1 VFSClassLoader (org.apache.commons.vfs2.impl.VFSClassLoader)1 AnnotatedClassDescriptor (org.apache.drill.common.scanner.persistence.AnnotatedClassDescriptor)1 ParentClassDescriptor (org.apache.drill.common.scanner.persistence.ParentClassDescriptor)1