Search in sources :

Example 1 with ExecutionRequest

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

the class LauncherBasedEnableRuleMigrationSupportTests method executeTests.

private ExecutionEventRecorder executeTests(LauncherDiscoveryRequest request) {
    TestDescriptor testDescriptor = discoverTests(request);
    ExecutionEventRecorder eventRecorder = new ExecutionEventRecorder();
    engine.execute(new ExecutionRequest(testDescriptor, eventRecorder, request.getConfigurationParameters()));
    return eventRecorder;
}
Also used : ExecutionEventRecorder(org.junit.platform.engine.test.event.ExecutionEventRecorder) ExecutionRequest(org.junit.platform.engine.ExecutionRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor)

Example 2 with ExecutionRequest

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

the class DefaultLauncher method execute.

private void execute(Root root, ConfigurationParameters configurationParameters, TestExecutionListener... listeners) {
    TestExecutionListenerRegistry listenerRegistry = buildListenerRegistryForExecution(listeners);
    TestPlan testPlan = TestPlan.from(root.getEngineDescriptors());
    TestExecutionListener testExecutionListener = listenerRegistry.getCompositeTestExecutionListener();
    testExecutionListener.testPlanExecutionStarted(testPlan);
    ExecutionListenerAdapter engineExecutionListener = new ExecutionListenerAdapter(testPlan, testExecutionListener);
    for (TestEngine testEngine : root.getTestEngines()) {
        TestDescriptor testDescriptor = root.getTestDescriptorFor(testEngine);
        execute(testEngine, new ExecutionRequest(testDescriptor, engineExecutionListener, configurationParameters));
    }
    testExecutionListener.testPlanExecutionFinished(testPlan);
}
Also used : TestPlan(org.junit.platform.launcher.TestPlan) TestExecutionListener(org.junit.platform.launcher.TestExecutionListener) TestEngine(org.junit.platform.engine.TestEngine) ExecutionRequest(org.junit.platform.engine.ExecutionRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor)

Example 3 with ExecutionRequest

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

the class ExecutionEventRecorder method execute.

public static void execute(TestEngine testEngine, EngineDiscoveryRequest discoveryRequest, EngineExecutionListener listener) {
    TestDescriptor engineTestDescriptor = testEngine.discover(discoveryRequest, UniqueId.forEngine(testEngine.getId()));
    testEngine.execute(new ExecutionRequest(engineTestDescriptor, listener, discoveryRequest.getConfigurationParameters()));
}
Also used : ExecutionRequest(org.junit.platform.engine.ExecutionRequest) ExecutionEvent.byTestDescriptor(org.junit.platform.engine.test.event.ExecutionEvent.byTestDescriptor) TestDescriptor(org.junit.platform.engine.TestDescriptor)

Example 4 with ExecutionRequest

use of org.junit.platform.engine.ExecutionRequest in project cucumber-jvm by cucumber.

the class CucumberTestEngineTest method createExecutionContext.

@Test
void createExecutionContext() {
    EngineExecutionListener listener = new EmptyEngineExecutionListener();
    ConfigurationParameters configuration = new EmptyConfigurationParameters();
    EngineDiscoveryRequest discoveryRequest = new EmptyEngineDiscoveryRequest(configuration);
    UniqueId id = UniqueId.forEngine(engine.getId());
    TestDescriptor testDescriptor = engine.discover(discoveryRequest, id);
    ExecutionRequest execution = new ExecutionRequest(testDescriptor, listener, configuration);
    assertNotNull(engine.createExecutionContext(execution));
}
Also used : UniqueId(org.junit.platform.engine.UniqueId) EngineExecutionListener(org.junit.platform.engine.EngineExecutionListener) ExecutionRequest(org.junit.platform.engine.ExecutionRequest) ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) EngineDiscoveryRequest(org.junit.platform.engine.EngineDiscoveryRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor) Test(org.junit.jupiter.api.Test)

Example 5 with ExecutionRequest

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

the class AbstractJupiterTestEngineTests method executeTests.

protected ExecutionEventRecorder executeTests(LauncherDiscoveryRequest request) {
    TestDescriptor testDescriptor = discoverTests(request);
    ExecutionEventRecorder eventRecorder = new ExecutionEventRecorder();
    engine.execute(new ExecutionRequest(testDescriptor, eventRecorder, request.getConfigurationParameters()));
    return eventRecorder;
}
Also used : 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)8 TestDescriptor (org.junit.platform.engine.TestDescriptor)7 ExecutionEventRecorder (org.junit.platform.engine.test.event.ExecutionEventRecorder)3 Test (org.junit.jupiter.api.Test)2 EngineDiscoveryRequest (org.junit.platform.engine.EngineDiscoveryRequest)2 EngineExecutionListener (org.junit.platform.engine.EngineExecutionListener)2 UniqueId (org.junit.platform.engine.UniqueId)2 TestExecutionListener (org.junit.platform.launcher.TestExecutionListener)2 TestPlan (org.junit.platform.launcher.TestPlan)2 BeforeEach (org.junit.jupiter.api.BeforeEach)1 JupiterTestEngine (org.junit.jupiter.engine.JupiterTestEngine)1 ConfigurationParameters (org.junit.platform.engine.ConfigurationParameters)1 TestEngine (org.junit.platform.engine.TestEngine)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