Search in sources :

Example 1 with Filter

use of org.junit.platform.engine.Filter in project junit5 by junit-team.

the class JUnitPlatformProvider method getFilters.

private Filter<?>[] getFilters() {
    List<Filter<?>> filters = new ArrayList<>();
    Optional<List<String>> includes = getGroupsOrTags(getPropertiesList(INCLUDE_GROUPS), getPropertiesList(INCLUDE_TAGS));
    includes.map(TagFilter::includeTags).ifPresent(filters::add);
    Optional<List<String>> excludes = getGroupsOrTags(getPropertiesList(EXCLUDE_GROUPS), getPropertiesList(EXCLUDE_TAGS));
    excludes.map(TagFilter::excludeTags).ifPresent(filters::add);
    TestListResolver testListResolver = parameters.getTestRequest().getTestListResolver();
    if (!testListResolver.isEmpty()) {
        filters.add(new TestMethodFilter(testListResolver));
    }
    return filters.toArray(new Filter<?>[filters.size()]);
}
Also used : Filter(org.junit.platform.engine.Filter) TagFilter(org.junit.platform.launcher.TagFilter) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) TestListResolver(org.apache.maven.surefire.testset.TestListResolver)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 TestListResolver (org.apache.maven.surefire.testset.TestListResolver)1 Filter (org.junit.platform.engine.Filter)1 TagFilter (org.junit.platform.launcher.TagFilter)1