use of org.junit.platform.engine.test.event.ExecutionEventRecorder in project junit5 by junit-team.
the class ExtensionContextExecutionTests method twoTestClassesCanShareStateViaEngineExtensionContext.
@Test
void twoTestClassesCanShareStateViaEngineExtensionContext() {
Parent.counter.set(0);
ExecutionEventRecorder eventRecorder = executeTests(request().selectors(selectClass(A.class), selectClass(B.class)).build());
assertThat(eventRecorder.getTestFinishedCount()).isEqualTo(2);
assertThat(Parent.counter).hasValue(1);
}
use of org.junit.platform.engine.test.event.ExecutionEventRecorder in project junit5 by junit-team.
the class ParameterResolverTests method executeTestsForMethodInjectionInBeforeAndAfterEachMethods.
@Test
void executeTestsForMethodInjectionInBeforeAndAfterEachMethods() {
ExecutionEventRecorder eventRecorder = executeTestsForClass(BeforeAndAfterMethodInjectionTestCase.class);
assertEquals(1, eventRecorder.getTestStartedCount(), "# tests started");
assertEquals(1, eventRecorder.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(0, eventRecorder.getTestSkippedCount(), "# tests skipped");
assertEquals(0, eventRecorder.getTestAbortedCount(), "# tests aborted");
assertEquals(0, eventRecorder.getTestFailedCount(), "# tests failed");
}
use of org.junit.platform.engine.test.event.ExecutionEventRecorder in project junit5 by junit-team.
the class ParameterResolverTests method constructorInjectionWithAnnotatedParameter.
@Test
void constructorInjectionWithAnnotatedParameter() {
ExecutionEventRecorder eventRecorder = executeTestsForClass(AnnotatedParameterConstructorInjectionTestCase.class);
assertEquals(2, eventRecorder.getTestStartedCount(), "# tests started");
assertEquals(2, eventRecorder.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(0, eventRecorder.getTestSkippedCount(), "# tests skipped");
assertEquals(0, eventRecorder.getTestAbortedCount(), "# tests aborted");
assertEquals(0, eventRecorder.getTestFailedCount(), "# tests failed");
}
use of org.junit.platform.engine.test.event.ExecutionEventRecorder in project junit5 by junit-team.
the class ParameterResolverTests method executeTestsForMethodInjectionInBeforeAndAfterAllMethods.
@Test
void executeTestsForMethodInjectionInBeforeAndAfterAllMethods() {
ExecutionEventRecorder eventRecorder = executeTestsForClass(BeforeAndAfterAllMethodInjectionTestCase.class);
assertEquals(1, eventRecorder.getTestStartedCount(), "# tests started");
assertEquals(1, eventRecorder.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(0, eventRecorder.getTestSkippedCount(), "# tests skipped");
assertEquals(0, eventRecorder.getTestAbortedCount(), "# tests aborted");
assertEquals(0, eventRecorder.getTestFailedCount(), "# tests failed");
}
use of org.junit.platform.engine.test.event.ExecutionEventRecorder in project junit5 by junit-team.
the class ParameterResolverTests method executeTestsForPrimitiveArrayMethodInjectionCases.
@Test
void executeTestsForPrimitiveArrayMethodInjectionCases() {
ExecutionEventRecorder eventRecorder = executeTestsForClass(PrimitiveArrayMethodInjectionTestCase.class);
assertEquals(1, eventRecorder.getTestStartedCount(), "# tests started");
assertEquals(1, eventRecorder.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(0, eventRecorder.getTestFailedCount(), "# tests failed");
}
Aggregations