use of org.junit.platform.suite.api.SelectClasspathResource in project junit5 by junit-team.
the class SuiteLauncherDiscoveryRequestBuilderTests method selectClasspathResource.
@Test
void selectClasspathResource() {
@SelectClasspathResource("com.example.testcases")
class Suite {
}
LauncherDiscoveryRequest request = builder.suite(Suite.class).build();
List<ClasspathResourceSelector> selectors = request.getSelectorsByType(ClasspathResourceSelector.class);
assertEquals("com.example.testcases", exactlyOne(selectors).getClasspathResourceName());
}
use of org.junit.platform.suite.api.SelectClasspathResource in project junit5 by junit-team.
the class SuiteLauncherDiscoveryRequestBuilderTests method selectClasspathResourcePosition.
@Test
void selectClasspathResourcePosition() {
@SelectClasspathResource(value = "com.example.testcases", line = 42)
@SelectClasspathResource(value = "com.example.testcases", line = 14, column = 15)
class Suite {
}
LauncherDiscoveryRequest request = builder.suite(Suite.class).build();
List<ClasspathResourceSelector> selectors = request.getSelectorsByType(ClasspathResourceSelector.class);
assertEquals(Optional.of(FilePosition.from(42)), selectors.get(0).getPosition());
assertEquals(Optional.of(FilePosition.from(14, 15)), selectors.get(1).getPosition());
}
use of org.junit.platform.suite.api.SelectClasspathResource in project junit5 by junit-team.
the class SuiteLauncherDiscoveryRequestBuilderTests method ignoreClasspathResourcePosition.
@Test
void ignoreClasspathResourcePosition() {
@SelectClasspathResource(value = "com.example.testcases", line = -1)
@SelectClasspathResource(value = "com.example.testcases", column = 12)
@SelectClasspathResource(value = "com.example.testcases", line = 42, column = -12)
class Suite {
}
LauncherDiscoveryRequest request = builder.suite(Suite.class).build();
List<ClasspathResourceSelector> selectors = request.getSelectorsByType(ClasspathResourceSelector.class);
assertEquals(Optional.empty(), selectors.get(0).getPosition());
assertEquals(Optional.empty(), selectors.get(1).getPosition());
assertEquals(Optional.of(FilePosition.from(42)), selectors.get(2).getPosition());
}
Aggregations