Search in sources :

Example 1 with ClassNameFilter

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

the class DiscoveryRequestCreatorTests method convertsDefaultIncludeClassNamePatternOption.

@Test
void convertsDefaultIncludeClassNamePatternOption() {
    options.setScanClasspath(true);
    LauncherDiscoveryRequest request = convert();
    List<ClassNameFilter> filter = request.getFiltersByType(ClassNameFilter.class);
    assertThat(filter).hasSize(1);
    assertThat(filter.get(0).toString()).contains(STANDARD_INCLUDE_PATTERN);
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) ClassNameFilter(org.junit.platform.engine.discovery.ClassNameFilter) Test(org.junit.jupiter.api.Test)

Example 2 with ClassNameFilter

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

the class DiscoveryRequestCreatorTests method convertsExcludeClassNamePatternOption.

@Test
void convertsExcludeClassNamePatternOption() {
    options.setScanClasspath(true);
    options.setExcludedClassNamePatterns(asList("Foo.*Bar", "Bar.*Foo"));
    LauncherDiscoveryRequest request = convert();
    List<ClassNameFilter> filter = request.getFiltersByType(ClassNameFilter.class);
    assertThat(filter).hasSize(2);
    assertThat(filter.get(1).toString()).contains("Foo.*Bar");
    assertThat(filter.get(1).toString()).contains("Bar.*Foo");
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) ClassNameFilter(org.junit.platform.engine.discovery.ClassNameFilter) Test(org.junit.jupiter.api.Test)

Example 3 with ClassNameFilter

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

the class DiscoveryRequestCreatorTests method convertsExplicitIncludeClassNamePatternOption.

@Test
void convertsExplicitIncludeClassNamePatternOption() {
    options.setScanClasspath(true);
    options.setIncludedClassNamePatterns(asList("Foo.*Bar", "Bar.*Foo"));
    LauncherDiscoveryRequest request = convert();
    List<ClassNameFilter> filter = request.getFiltersByType(ClassNameFilter.class);
    assertThat(filter).hasSize(1);
    assertThat(filter.get(0).toString()).contains("Foo.*Bar");
    assertThat(filter.get(0).toString()).contains("Bar.*Foo");
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) ClassNameFilter(org.junit.platform.engine.discovery.ClassNameFilter) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)3 ClassNameFilter (org.junit.platform.engine.discovery.ClassNameFilter)3 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)3