use of org.junit.platform.testkit.engine.EngineExecutionResults in project junit5 by junit-team.
the class TestTemplateInvocationTests method templateWithSupportingProviderButNoInvocationsReportsFailure.
@Test
void templateWithSupportingProviderButNoInvocationsReportsFailure() {
LauncherDiscoveryRequest request = request().selectors(selectMethod(MyTestTemplateTestCase.class, "templateWithSupportingProviderButNoInvocations")).build();
EngineExecutionResults executionResults = executeTests(request);
//
executionResults.allEvents().assertEventsMatchExactly(wrappedInContainerEvents(//
MyTestTemplateTestCase.class, //
event(container("templateWithSupportingProviderButNoInvocations"), started()), event(container("templateWithSupportingProviderButNoInvocations"), finishedWithFailure(message("None of the supporting TestTemplateInvocationContextProviders [" + InvocationContextProviderThatSupportsEverythingButProvidesNothing.class.getSimpleName() + "] provided a non-empty stream")))));
}
use of org.junit.platform.testkit.engine.EngineExecutionResults in project junit5 by junit-team.
the class TestTemplateInvocationTests method templateWithTwoRegisteredExtensionsIsInvoked.
@Test
void templateWithTwoRegisteredExtensionsIsInvoked() {
LauncherDiscoveryRequest request = request().selectors(selectMethod(MyTestTemplateTestCase.class, "templateWithTwoRegisteredExtensions")).build();
EngineExecutionResults executionResults = executeTests(request);
//
executionResults.allEvents().assertEventsMatchExactly(wrappedInContainerEvents(//
MyTestTemplateTestCase.class, //
event(container("templateWithTwoRegisteredExtensions"), started()), //
event(dynamicTestRegistered("test-template-invocation:#1"), displayName("[1]")), //
event(test("test-template-invocation:#1"), started()), event(test("test-template-invocation:#1"), //
finishedWithFailure(message("invocation is expected to fail"))), //
event(dynamicTestRegistered("test-template-invocation:#2"), displayName("[2]")), //
event(test("test-template-invocation:#2"), started()), event(test("test-template-invocation:#2"), //
finishedWithFailure(message("invocation is expected to fail"))), event(container("templateWithTwoRegisteredExtensions"), finishedSuccessfully())));
}
use of org.junit.platform.testkit.engine.EngineExecutionResults in project junit5 by junit-team.
the class TestTemplateInvocationTests method disabledTemplateIsSkipped.
@Test
void disabledTemplateIsSkipped() {
LauncherDiscoveryRequest request = request().selectors(selectMethod(MyTestTemplateTestCase.class, "disabledTemplate")).build();
EngineExecutionResults executionResults = executeTests(request);
//
executionResults.allEvents().assertEventsMatchExactly(wrappedInContainerEvents(//
MyTestTemplateTestCase.class, event(container("disabledTemplate"), skippedWithReason("always disabled"))));
}
use of org.junit.platform.testkit.engine.EngineExecutionResults in project junit5 by junit-team.
the class TestTemplateInvocationTests method templateWithCustomizedDisplayNamesIsInvoked.
@Test
void templateWithCustomizedDisplayNamesIsInvoked() {
LauncherDiscoveryRequest request = request().selectors(selectMethod(MyTestTemplateTestCase.class, "templateWithCustomizedDisplayNames")).build();
EngineExecutionResults executionResults = executeTests(request);
//
executionResults.allEvents().assertEventsMatchExactly(wrappedInContainerEvents(//
MyTestTemplateTestCase.class, //
event(container("templateWithCustomizedDisplayNames"), started()), event(dynamicTestRegistered("test-template-invocation:#1"), //
displayName("1 --> templateWithCustomizedDisplayNames()")), //
event(test("test-template-invocation:#1"), started()), event(test("test-template-invocation:#1"), //
finishedWithFailure(message("invocation is expected to fail"))), event(container("templateWithCustomizedDisplayNames"), finishedSuccessfully())));
}
use of org.junit.platform.testkit.engine.EngineExecutionResults in project junit5 by junit-team.
the class ExceptionHandlingTests method checkedExceptionInAfterAllIsRegistered.
@Test
void checkedExceptionInAfterAllIsRegistered() {
Class<?> testClass = FailureTestCase.class;
FailureTestCase.exceptionToThrowInAfterAll = Optional.of(new IOException("checked"));
EngineExecutionResults executionResults = executeTests(selectMethod(testClass, "succeedingTest"));
//
executionResults.allEvents().assertEventsMatchExactly(//
event(engine(), started()), //
event(container(testClass), started()), //
event(test("succeedingTest"), started()), //
event(test("succeedingTest"), finishedSuccessfully()), //
event(container(testClass), finishedWithFailure(instanceOf(IOException.class), message("checked"))), event(engine(), finishedSuccessfully()));
}
Aggregations