Search in sources :

Example 1 with DirectorySelector

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

the class DiscoveryRequestCreatorTests method convertsDirectorySelectors.

@Test
void convertsDirectorySelectors() {
    options.setSelectedDirectories(asList("foo/bar", "bar/qux"));
    LauncherDiscoveryRequest request = convert();
    List<DirectorySelector> directorySelectors = request.getSelectorsByType(DirectorySelector.class);
    assertThat(directorySelectors).extracting(DirectorySelector::getRawPath).containsExactly("foo/bar", "bar/qux");
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) DirectorySelector(org.junit.platform.engine.discovery.DirectorySelector) Test(org.junit.jupiter.api.Test)

Example 2 with DirectorySelector

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

the class SuiteLauncherDiscoveryRequestBuilderTests method selectDirectories.

@Test
void selectDirectories() {
    @SelectDirectories("path/to/root")
    class Suite {
    }
    LauncherDiscoveryRequest request = builder.suite(Suite.class).build();
    List<DirectorySelector> selectors = request.getSelectorsByType(DirectorySelector.class);
    assertEquals(Paths.get("path/to/root"), exactlyOne(selectors).getPath());
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) DirectorySelector(org.junit.platform.engine.discovery.DirectorySelector) SelectDirectories(org.junit.platform.suite.api.SelectDirectories) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 DirectorySelector (org.junit.platform.engine.discovery.DirectorySelector)2 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)2 SelectDirectories (org.junit.platform.suite.api.SelectDirectories)1