use of org.junit.platform.engine.test.TestEngineStub in project junit5 by junit-team.
the class DefaultLauncherTests method discoverTestPlanForEngineThatThrowsAnErrorInDiscoverPhase.
@Test
void discoverTestPlanForEngineThatThrowsAnErrorInDiscoverPhase() {
TestEngine engine = new TestEngineStub() {
@Override
public TestDescriptor discover(org.junit.platform.engine.EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
throw new Error("ignored");
}
};
TestPlan testPlan = createLauncher(engine).discover(request().build());
assertThat(testPlan.getRoots()).hasSize(0);
}
use of org.junit.platform.engine.test.TestEngineStub in project junit5 by junit-team.
the class DefaultLauncherTests method discoverTestPlanForEngineThatThrowsRuntimeExceptionInDiscoverPhase.
@Test
void discoverTestPlanForEngineThatThrowsRuntimeExceptionInDiscoverPhase() {
TestEngine engine = new TestEngineStub() {
@Override
public TestDescriptor discover(org.junit.platform.engine.EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
throw new RuntimeException("ignored");
}
};
TestPlan testPlan = createLauncher(engine).discover(request().build());
assertThat(testPlan.getRoots()).hasSize(0);
}
use of org.junit.platform.engine.test.TestEngineStub in project junit5 by junit-team.
the class DefaultLauncherTests method discoverTestPlanForEngineThatReturnsNullForItsRootDescriptor.
@Test
void discoverTestPlanForEngineThatReturnsNullForItsRootDescriptor() {
TestEngine engine = new TestEngineStub() {
@Override
public TestDescriptor discover(org.junit.platform.engine.EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
return null;
}
};
TestPlan testPlan = createLauncher(engine).discover(request().build());
assertThat(testPlan.getRoots()).hasSize(0);
}
Aggregations