org.junit.platform.engine.ExecutionRequest Java Examples
The following examples show how to use
org.junit.platform.engine.ExecutionRequest.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestClassExecutor.java From webtester2-core with Apache License 2.0 | 6 votes |
public static void execute(Class<?> testClass) throws Exception { try { JupiterTestEngine engine = new JupiterTestEngine(); TestClassEngineDiscoveryRequest discoveryRequest = new TestClassEngineDiscoveryRequest(testClass); TestDescriptor testDescriptor = engine.discover(discoveryRequest, UniqueId.forEngine("foo-bar")); EngineExecutionListener listener = new NoOpEngineExecutionListener(); ConfigurationParameters parameters = new NoConfigurationParameters(); engine.execute(new ExecutionRequest(testDescriptor, listener, parameters)); } catch (UndeclaredThrowableException e) { Throwable cause = getFirstNonUndeclaredThrowableCause(e); if (cause instanceof Error) { throw ( Error ) cause; } else if (cause instanceof RuntimeException) { throw ( RuntimeException ) cause; } else if (cause instanceof Exception) { throw ( Exception ) cause; } else { throw e; } } }
Example #2
Source File: MyCustomEngine.java From mastering-junit5 with Apache License 2.0 | 5 votes |
@Override public void execute(ExecutionRequest request) { // Use ExecutionRequest to execute TestDescriptor TestDescriptor rootTestDescriptor = request.getRootTestDescriptor(); request.getEngineExecutionListener() .executionStarted(rootTestDescriptor); }
Example #3
Source File: MyCustomEngine.java From Mastering-Software-Testing-with-JUnit-5 with MIT License | 5 votes |
@Override public void execute(ExecutionRequest request) { // Use ExecutionRequest to execute TestDescriptor TestDescriptor rootTestDescriptor = request.getRootTestDescriptor(); request.getEngineExecutionListener() .executionStarted(rootTestDescriptor); }
Example #4
Source File: ArchUnitTestEngineTest.java From ArchUnit with Apache License 2.0 | 5 votes |
private EngineExecutionTestListener execute(UniqueId uniqueId, EngineDiscoveryTestRequest discoveryRequest) { TestDescriptor descriptor = testEngine.discover(discoveryRequest, uniqueId); EngineExecutionTestListener listener = new EngineExecutionTestListener(); testEngine.execute(new ExecutionRequest(descriptor, listener, discoveryRequest.getConfigurationParameters())); return listener; }
Example #5
Source File: JupiterTestEngineForTests.java From junit5-docker with Apache License 2.0 | 5 votes |
private JupiterExecutionListener executeTests(LauncherDiscoveryRequest request) throws Exception { TestDescriptor testDescriptor = createTestDescriptorForCucumber( engine.discover(request, forEngine(engine.getId())), containers); eventRecorder.reset(); engine.execute(new ExecutionRequest(testDescriptor, eventRecorder, request.getConfigurationParameters())); return eventRecorder; }
Example #6
Source File: ArchUnitTestEngine.java From ArchUnit with Apache License 2.0 | 4 votes |
@Override protected ArchUnitEngineExecutionContext createExecutionContext(ExecutionRequest request) { return new ArchUnitEngineExecutionContext(); }