Search in sources :

Example 1 with SelectDirectories

use of org.junit.platform.suite.api.SelectDirectories in project junit5 by junit-team.

the class SuiteLauncherDiscoveryRequestBuilderTests method selectDirectoriesFiltersEmptyPaths.

@Test
void selectDirectoriesFiltersEmptyPaths() {
    @SelectDirectories("")
    class Suite {
    }
    LauncherDiscoveryRequest request = builder.suite(Suite.class).build();
    assertTrue(request.getSelectorsByType(DirectorySelector.class).isEmpty());
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) SelectDirectories(org.junit.platform.suite.api.SelectDirectories) Test(org.junit.jupiter.api.Test)

Example 2 with SelectDirectories

use of org.junit.platform.suite.api.SelectDirectories 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 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)2 SelectDirectories (org.junit.platform.suite.api.SelectDirectories)2 DirectorySelector (org.junit.platform.engine.discovery.DirectorySelector)1