use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryRequestCreatorTests method convertsEngineOptions.
@Test
void convertsEngineOptions() {
options.setScanClasspath(true);
options.setIncludedEngines(asList("engine1", "engine2", "engine3"));
options.setExcludedEngines(singletonList("engine2"));
LauncherDiscoveryRequest request = convert();
List<EngineFilter> engineFilters = request.getEngineFilters();
assertThat(engineFilters).hasSize(2);
assertThat(engineFilters.get(0).toString()).contains("includes", "[engine1, engine2, engine3]");
assertThat(engineFilters.get(1).toString()).contains("excludes", "[engine2]");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryRequestCreatorTests method convertsPackageSelectors.
@Test
void convertsPackageSelectors() {
options.setSelectedPackages(asList("com.acme.foo", "com.example.bar"));
LauncherDiscoveryRequest request = convert();
List<PackageSelector> packageSelectors = request.getSelectorsByType(PackageSelector.class);
assertThat(packageSelectors).extracting(PackageSelector::getPackageName).containsExactly("com.acme.foo", "com.example.bar");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryRequestCreatorTests method convertsClassSelectors.
@Test
void convertsClassSelectors() {
options.setSelectedClasses(asList("com.acme.Foo", "com.example.Bar"));
LauncherDiscoveryRequest request = convert();
List<ClassSelector> classSelectors = request.getSelectorsByType(ClassSelector.class);
assertThat(classSelectors).extracting(ClassSelector::getClassName).containsExactly("com.acme.Foo", "com.example.Bar");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryRequestCreatorTests method convertsFileSelectors.
@Test
void convertsFileSelectors() {
options.setSelectedFiles(asList("foo.txt", "bar.csv"));
LauncherDiscoveryRequest request = convert();
List<FileSelector> fileSelectors = request.getSelectorsByType(FileSelector.class);
assertThat(fileSelectors).extracting(FileSelector::getRawPath).containsExactly("foo.txt", "bar.csv");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryRequestCreatorTests method convertsTagOptions.
@Test
void convertsTagOptions() {
options.setScanClasspath(true);
options.setIncludedTagExpressions(asList("fast", "medium", "slow"));
options.setExcludedTagExpressions(asList("slow"));
LauncherDiscoveryRequest request = convert();
List<PostDiscoveryFilter> postDiscoveryFilters = request.getPostDiscoveryFilters();
assertThat(postDiscoveryFilters).hasSize(2);
assertThat(postDiscoveryFilters.get(0).toString()).contains("TagFilter");
assertThat(postDiscoveryFilters.get(1).toString()).contains("TagFilter");
}
Aggregations