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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
Aggregations