Search in sources :

Example 6 with ExecutionRequest

use of org.junit.platform.engine.ExecutionRequest in project junit5 by junit-team.

the class HierarchicalTestExecutorTests method init.

@BeforeEach
void init() {
    ExecutionRequest request = new ExecutionRequest(root, listener, null);
    executor = new MyExecutor(request, rootContext);
}
Also used : ExecutionRequest(org.junit.platform.engine.ExecutionRequest) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with ExecutionRequest

use of org.junit.platform.engine.ExecutionRequest in project junit5 by junit-team.

the class ExpectedExceptionSupportTests method executeTestsForClass.

private ExecutionEventRecorder executeTestsForClass(Class<?> testClass) {
    LauncherDiscoveryRequest request = request().selectors(selectClass(testClass)).build();
    JupiterTestEngine engine = new JupiterTestEngine();
    TestDescriptor testDescriptor = engine.discover(request, UniqueId.forEngine(engine.getId()));
    ExecutionEventRecorder eventRecorder = new ExecutionEventRecorder();
    engine.execute(new ExecutionRequest(testDescriptor, eventRecorder, request.getConfigurationParameters()));
    return eventRecorder;
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) JupiterTestEngine(org.junit.jupiter.engine.JupiterTestEngine) ExecutionEventRecorder(org.junit.platform.engine.test.event.ExecutionEventRecorder) ExecutionRequest(org.junit.platform.engine.ExecutionRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor)

Aggregations

ExecutionRequest (org.junit.platform.engine.ExecutionRequest)7 TestDescriptor (org.junit.platform.engine.TestDescriptor)6 ExecutionEventRecorder (org.junit.platform.engine.test.event.ExecutionEventRecorder)3 TestExecutionListener (org.junit.platform.launcher.TestExecutionListener)2 TestPlan (org.junit.platform.launcher.TestPlan)2 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 JupiterTestEngine (org.junit.jupiter.engine.JupiterTestEngine)1 EngineDiscoveryRequest (org.junit.platform.engine.EngineDiscoveryRequest)1 EngineExecutionListener (org.junit.platform.engine.EngineExecutionListener)1 TestEngine (org.junit.platform.engine.TestEngine)1 UniqueId (org.junit.platform.engine.UniqueId)1 DiscoverySelectors.selectUniqueId (org.junit.platform.engine.discovery.DiscoverySelectors.selectUniqueId)1 DemoHierarchicalTestDescriptor (org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestDescriptor)1 TestDescriptorStub (org.junit.platform.engine.test.TestDescriptorStub)1 TestEngineSpy (org.junit.platform.engine.test.TestEngineSpy)1 ExecutionEvent.byTestDescriptor (org.junit.platform.engine.test.event.ExecutionEvent.byTestDescriptor)1 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)1 TestIdentifier (org.junit.platform.launcher.TestIdentifier)1 InOrder (org.mockito.InOrder)1