use of org.junit.platform.engine.discovery.PackageSelector 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.engine.discovery.PackageSelector in project junit5 by junit-team.
the class TestClassWithTemplate method packageResolutionUsingExplicitBasePackage.
@Test
void packageResolutionUsingExplicitBasePackage() {
PackageSelector selector = selectPackage("org.junit.jupiter.engine.descriptor.subpackage");
resolver.resolveSelectors(request().selectors(selector).build(), engineDescriptor);
assertEquals(6, engineDescriptor.getDescendants().size());
List<UniqueId> uniqueIds = uniqueIds();
assertThat(uniqueIds).contains(uniqueIdForClass(Class1WithTestCases.class));
assertThat(uniqueIds).contains(uniqueIdForMethod(Class1WithTestCases.class, "test1()"));
assertThat(uniqueIds).contains(uniqueIdForClass(Class2WithTestCases.class));
assertThat(uniqueIds).contains(uniqueIdForMethod(Class2WithTestCases.class, "test2()"));
assertThat(uniqueIds).contains(uniqueIdForMethod(ClassWithStaticInnerTestCases.ShouldBeDiscovered.class, "test1()"));
}
Aggregations