Search in sources :

Example 6 with TestEngineStub

use of org.junit.platform.fakes.TestEngineStub in project junit5 by junit-team.

the class LauncherConfigTests method preconditions.

@Test
void preconditions() {
    assertThrows(PreconditionViolationException.class, () -> LauncherConfig.builder().addTestEngines((TestEngine[]) null));
    assertThrows(PreconditionViolationException.class, () -> LauncherConfig.builder().addTestExecutionListeners((TestExecutionListener[]) null));
    TestEngine engine = new TestEngineStub();
    var listener = new TestExecutionListener() {
    };
    assertThrows(PreconditionViolationException.class, () -> LauncherConfig.builder().addTestEngines(engine, engine, null));
    assertThrows(PreconditionViolationException.class, () -> LauncherConfig.builder().addTestExecutionListeners(listener, listener, null));
}
Also used : TestExecutionListener(org.junit.platform.launcher.TestExecutionListener) TestEngine(org.junit.platform.engine.TestEngine) TestEngineStub(org.junit.platform.fakes.TestEngineStub) Test(org.junit.jupiter.api.Test)

Aggregations

TestEngineStub (org.junit.platform.fakes.TestEngineStub)6 TestEngine (org.junit.platform.engine.TestEngine)5 Test (org.junit.jupiter.api.Test)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 DemoHierarchicalTestEngine (org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine)3 JUnitException (org.junit.platform.commons.JUnitException)2 PreconditionViolationException (org.junit.platform.commons.PreconditionViolationException)2 EngineDiscoveryRequest (org.junit.platform.engine.EngineDiscoveryRequest)2 UniqueId (org.junit.platform.engine.UniqueId)2 DiscoverySelectors.selectUniqueId (org.junit.platform.engine.discovery.DiscoverySelectors.selectUniqueId)2 LogRecord (java.util.logging.LogRecord)1 TrackLogRecords (org.junit.jupiter.api.fixtures.TrackLogRecords)1 ValueSource (org.junit.jupiter.params.provider.ValueSource)1 TestExecutionListener (org.junit.platform.launcher.TestExecutionListener)1