use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class SuppressOutputExtensionTest method shouldThrowExceptionOnMissingResourceLock.
@Test
void shouldThrowExceptionOnMissingResourceLock() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(SuppressOutputExtensionIncorrectUsage.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(IllegalStateException.class), message(message -> message.contains("SuppressOutputExtension requires `@ResourceLock( Resources.SYSTEM_OUT )` annotation.")))));
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class ThreadLeakageGuardExtensionTest method threadLeakageTest.
@Test
void threadLeakageTest() throws InterruptedException {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(IncorrectThreadLeakage.class)).execute().allEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(ExtensionContextException.class), message(message -> message.contains("1 leaked thread(s) detected")))));
IncorrectThreadLeakage.cleanUp();
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class JUnitUsageGuardExtensionTest method validTestUsage.
@Test
void validTestUsage() {
Events testEvents = executeTest(ValidUsage.class);
assertEquals(0, testEvents.failed().count());
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class JUnitUsageGuardExtensionTest method detectMixtureOfDifferentTests.
@Test
void detectMixtureOfDifferentTests() {
Events testEvents = executeTest(MixOfDifferentJUnits.class);
verifyFailureMessage(testEvents, "Detected Junit 4 classes: [org.junit.Test]");
}
use of org.junit.platform.testkit.engine.Events in project neo4j by neo4j.
the class JUnitUsageGuardExtensionTest method deleteOldRuleAndNewTest.
@Test
void deleteOldRuleAndNewTest() {
Events testEvents = executeTest(MixRuleAndNewJUnit.class);
verifyFailureMessage(testEvents, "Detected Junit 4 classes: [org.junit.Rule, org.junit.rules.ExpectedException]");
}
Aggregations