@API(status=INTERNAL,
since="5.0")
public final class JupiterTestEngine
extends HierarchicalTestEngine<JupiterEngineExecutionContext>
TestEngine.| Constructor and Description |
|---|
JupiterTestEngine() |
| Modifier and Type | Method and Description |
|---|---|
protected JupiterEngineExecutionContext |
createExecutionContext(ExecutionRequest request)
Create the initial execution context for executing the supplied
request.
|
protected HierarchicalTestExecutorService |
createExecutorService(ExecutionRequest request)
Create the executor service
to use for executing the supplied request.
|
protected ThrowableCollector.Factory |
createThrowableCollectorFactory(ExecutionRequest request)
Create the factory for creating
ThrowableCollector instances used to handle exceptions that occur
during execution of this engine's tests. |
TestDescriptor |
discover(EngineDiscoveryRequest discoveryRequest,
UniqueId uniqueId)
Discover tests according to the supplied
EngineDiscoveryRequest. |
Optional<String> |
getArtifactId()
Returns
junit-jupiter-engine as the artifact ID. |
Optional<String> |
getGroupId()
Returns
org.junit.jupiter as the group ID. |
String |
getId()
Get the ID that uniquely identifies this test engine.
|
executeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetVersionpublic String getId()
TestEngineEach test engine must provide a unique ID. For example, JUnit Vintage
and JUnit Jupiter use "junit-vintage" and "junit-jupiter",
respectively. When in doubt, you may use the fully qualified name of your
custom TestEngine implementation class.
public Optional<String> getGroupId()
org.junit.jupiter as the group ID.Optional containing the group ID; never null
but potentially empty if the group ID is unknownTestEngine.getArtifactId(),
TestEngine.getVersion()public Optional<String> getArtifactId()
junit-jupiter-engine as the artifact ID.Optional containing the artifact ID; never
null but potentially empty if the artifact ID is unknownClass.getPackage(),
Package.getImplementationTitle(),
TestEngine.getGroupId(),
TestEngine.getVersion()public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId)
TestEngineEngineDiscoveryRequest.
The supplied UniqueId must be used as the unique ID of the
returned root TestDescriptor. In addition, the UniqueId
must be used to create unique IDs for children of the root's descriptor
by calling UniqueId.append(java.lang.String, java.lang.String).
discoveryRequest - the discovery request; never nulluniqueId - the unique ID to be used for this test engine's
TestDescriptor; never nullTestDescriptor of this engine, typically an
instance of EngineDescriptorEngineDescriptorprotected HierarchicalTestExecutorService createExecutorService(ExecutionRequest request)
HierarchicalTestEngineAn engine may use the information in the supplied request such as the contained configuration parameters to decide what kind of service to return or how to configure it.
By default, this method returns an instance of
SameThreadHierarchicalTestExecutorService.
createExecutorService in class HierarchicalTestEngine<JupiterEngineExecutionContext>request - the request about to be executedForkJoinPoolHierarchicalTestExecutorService,
SameThreadHierarchicalTestExecutorServiceprotected JupiterEngineExecutionContext createExecutionContext(ExecutionRequest request)
HierarchicalTestEnginecreateExecutionContext in class HierarchicalTestEngine<JupiterEngineExecutionContext>request - the request about to be executedprotected ThrowableCollector.Factory createThrowableCollectorFactory(ExecutionRequest request)
HierarchicalTestEngineThrowableCollector instances used to handle exceptions that occur
during execution of this engine's tests.
An engine may use the information in the supplied request such as the contained configuration parameters to decide what kind of factory to return or how to configure it.
By default, this method returns a factory that always creates instances of
OpenTest4JAwareThrowableCollector.
createThrowableCollectorFactory in class HierarchicalTestEngine<JupiterEngineExecutionContext>request - the request about to be executedOpenTest4JAwareThrowableCollector,
ThrowableCollectorCopyright © 2024. All rights reserved.