Search in sources :

Example 6 with FilterBuilder

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

the class FilterBuilderTest method test_includePackage.

@Test
public void test_includePackage() {
    FilterBuilder filter = new FilterBuilder().includePackage("org.reflections");
    assertTrue(filter.apply("org.reflections.Reflections"));
    assertTrue(filter.apply("org.reflections.foo.Reflections"));
    assertFalse(filter.apply("org.foobar.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Example 7 with FilterBuilder

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

the class FilterBuilderTest method test_parse_include.

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

Example 8 with FilterBuilder

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

the class FilterBuilderTest method test_parsePackages_include_exclude.

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

Example 9 with FilterBuilder

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

the class FilterBuilderTest method test_include.

@Test
public void test_include() {
    FilterBuilder filter = new FilterBuilder().include("org\\.reflections.*");
    assertTrue(filter.apply("org.reflections.Reflections"));
    assertTrue(filter.apply("org.reflections.foo.Reflections"));
    assertFalse(filter.apply("org.foobar.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Example 10 with FilterBuilder

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

the class FilterBuilderTest method test_includePackagebyClass.

@Test
public void test_includePackagebyClass() {
    FilterBuilder filter = new FilterBuilder().includePackage(Reflections.class);
    assertTrue(filter.apply("org.reflections.Reflections"));
    assertTrue(filter.apply("org.reflections.foo.Reflections"));
    assertFalse(filter.apply("org.foobar.Reflections"));
}
Also used : FilterBuilder(org.reflections.util.FilterBuilder) Test(org.junit.Test)

Aggregations

FilterBuilder (org.reflections.util.FilterBuilder)23 Test (org.junit.Test)17 ConfigurationBuilder (org.reflections.util.ConfigurationBuilder)6 Reflections (org.reflections.Reflections)4 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 BeforeClass (org.junit.BeforeClass)2 SubTypesScanner (org.reflections.scanners.SubTypesScanner)2 Stopwatch (com.google.common.base.Stopwatch)1 AnnotatedClassDescriptor (org.apache.drill.common.scanner.persistence.AnnotatedClassDescriptor)1 ParentClassDescriptor (org.apache.drill.common.scanner.persistence.ParentClassDescriptor)1 ScanResult (org.apache.drill.common.scanner.persistence.ScanResult)1 AbstractCasBanner (org.apereo.cas.util.spring.boot.AbstractCasBanner)1 DefaultCasBanner (org.apereo.cas.util.spring.boot.DefaultCasBanner)1 DL4JSubTypesScanner (org.deeplearning4j.util.reflections.DL4JSubTypesScanner)1 AnnotatedClass (org.nd4j.shade.jackson.databind.introspect.AnnotatedClass)1 NamedType (org.nd4j.shade.jackson.databind.jsontype.NamedType)1 FieldAnnotationsScanner (org.reflections.scanners.FieldAnnotationsScanner)1 MethodAnnotationsScanner (org.reflections.scanners.MethodAnnotationsScanner)1 MethodParameterScanner (org.reflections.scanners.MethodParameterScanner)1