use of org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine in project junit5 by junit-team.
the class DefaultLauncherTests method registerTestExecutionListenersWithEmptyArray.
@Test
void registerTestExecutionListenersWithEmptyArray() {
DefaultLauncher launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id"));
PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> launcher.registerTestExecutionListeners(new TestExecutionListener[0]));
assertThat(exception).hasMessageContaining("listeners array must not be null or empty");
}
use of org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine in project junit5 by junit-team.
the class DefaultLauncherTests method constructLauncherWithMultipleTestEnginesWithDuplicateIds.
@Test
void constructLauncherWithMultipleTestEnginesWithDuplicateIds() {
JUnitException exception = assertThrows(JUnitException.class, () -> createLauncher(new DemoHierarchicalTestEngine("dummy id"), new DemoHierarchicalTestEngine("dummy id")));
assertThat(exception).hasMessageContaining("multiple engines with the same ID");
}
use of org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine in project junit5 by junit-team.
the class DefaultLauncherTests method registerTestExecutionListenersWithNullArray.
@Test
void registerTestExecutionListenersWithNullArray() {
DefaultLauncher launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id"));
PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> launcher.registerTestExecutionListeners((TestExecutionListener[]) null));
assertThat(exception).hasMessageContaining("listeners array must not be null or empty");
}
use of org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine in project junit5 by junit-team.
the class DefaultLauncherTests method launcherWillNotExecuteEnginesExplicitlyIncludedViaMultipleCompetingEngineFilters.
@Test
void launcherWillNotExecuteEnginesExplicitlyIncludedViaMultipleCompetingEngineFilters() {
DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first");
TestDescriptor test1 = firstEngine.addTest("test1", noOp);
DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second");
TestDescriptor test2 = secondEngine.addTest("test2", noOp);
DefaultLauncher launcher = createLauncher(firstEngine, secondEngine);
// @formatter:off
TestPlan testPlan = launcher.discover(request().selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())).filters(includeEngines("first"), includeEngines("second")).build());
// @formatter:on
assertThat(testPlan.getRoots()).isEmpty();
}
use of org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine in project junit5 by junit-team.
the class DefaultLauncherTests method launcherWillExecuteAllEnginesExplicitlyIncludedViaSingleEngineFilter.
@Test
void launcherWillExecuteAllEnginesExplicitlyIncludedViaSingleEngineFilter() {
DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first");
TestDescriptor test1 = firstEngine.addTest("test1", noOp);
DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second");
TestDescriptor test2 = secondEngine.addTest("test2", noOp);
DefaultLauncher launcher = createLauncher(firstEngine, secondEngine);
// @formatter:off
TestPlan testPlan = launcher.discover(request().selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())).filters(includeEngines("first", "second")).build());
// @formatter:on
assertThat(testPlan.getRoots()).hasSize(2);
}
Aggregations