use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class TestInstancePostProcessorTests method testSpecificTestInstancePostProcessorIsCalled.
@Test
void testSpecificTestInstancePostProcessorIsCalled() {
LauncherDiscoveryRequest request = request().selectors(selectClass(TestCaseWithTestSpecificTestInstancePostProcessor.class)).build();
ExecutionEventRecorder eventRecorder = executeTests(request);
assertEquals(1, eventRecorder.getTestStartedCount(), "# tests started");
assertEquals(1, eventRecorder.getTestSuccessfulCount(), "# tests succeeded");
assertThat(callSequence).containsExactly("fooPostProcessTestInstance:TestCaseWithTestSpecificTestInstancePostProcessor", "beforeEachMethod", "test");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryTests method discoverTestTemplateMethodByUniqueId.
@Test
void discoverTestTemplateMethodByUniqueId() {
LauncherDiscoveryRequest spec = request().selectors(selectUniqueId(uniqueIdForTestTemplateMethod(TestTemplateClass.class, "testTemplate()"))).build();
TestDescriptor engineDescriptor = discoverTests(spec);
assertEquals(2, engineDescriptor.getDescendants().size(), "# resolved test descriptors");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryTests method discoverTestClass.
@Test
void discoverTestClass() {
LauncherDiscoveryRequest request = request().selectors(selectClass(LocalTestCase.class)).build();
TestDescriptor engineDescriptor = discoverTests(request);
assertEquals(7, engineDescriptor.getDescendants().size(), "# resolved test descriptors");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryTests method discoverMethodByMethodReference.
@Test
void discoverMethodByMethodReference() throws NoSuchMethodException {
Method testMethod = LocalTestCase.class.getDeclaredMethod("test3", new Class<?>[0]);
LauncherDiscoveryRequest request = request().selectors(selectMethod(LocalTestCase.class, testMethod)).build();
TestDescriptor engineDescriptor = discoverTests(request);
assertEquals(2, engineDescriptor.getDescendants().size(), "# resolved test descriptors");
}
use of org.junit.platform.launcher.LauncherDiscoveryRequest in project junit5 by junit-team.
the class DiscoveryTests method discoverMethodByUniqueIdForOverloadedMethod.
@Test
void discoverMethodByUniqueIdForOverloadedMethod() {
LauncherDiscoveryRequest request = request().selectors(selectUniqueId(JupiterUniqueIdBuilder.uniqueIdForMethod(LocalTestCase.class, "test4()"))).build();
TestDescriptor engineDescriptor = discoverTests(request);
assertEquals(2, engineDescriptor.getDescendants().size(), "# resolved test descriptors");
}
Aggregations