use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class DbmsExtensionTest method mixImpermanent.
@Test
void mixImpermanent() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(DbmsExtensionMixImpermanent.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(ExtensionContextException.class))));
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class DbmsExtensionTest method checkCallbackSignature.
@Test
void checkCallbackSignature() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(DbmsExtensionCheckCallbackSignature.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(IllegalArgumentException.class), message(message -> message.contains("must return void")))));
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(IllegalArgumentException.class), message(message -> message.contains("must take one parameter that is assignable from")))));
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(IllegalArgumentException.class), message(message -> message.contains("cannot be found.")))));
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class LifeExtensionTest method componentShutdownAfterTest.
@Test
void componentShutdownAfterTest() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(LifeExtensionComponentShutdownCase.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(RuntimeException.class), message(message -> message.contains("Shutdown exception.")))));
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class TestInstanceValidationExtensionTest method nonInjectedFieldVerified.
@Test
void nonInjectedFieldVerified() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(InjectionIncorrectUsage.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(ExtensionConfigurationException.class), message(message -> message.contains("Field lifeSupport that is marked for injection")))));
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class VerboseTimeoutExceptionExtensionTest method executeTest.
private static Events executeTest(String method) {
Events events = EngineTestKit.engine(ENGINE_ID).selectors(selectMethod(DumpThreadDumpOnTimeout.class, method)).execute().testEvents();
events.assertStatistics(stats -> stats.finished(1));
return events;
}
Aggregations