- All Implemented Interfaces:
TestEngine
TestEngine
.- Since:
- 5.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Create the factory for creatingThrowableCollector
instances used to handle exceptions that occur during execution of this engine's tests.discover
(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) Discover tests according to the suppliedEngineDiscoveryRequest
.Returnsjunit-jupiter-engine
as the artifact ID.Returnsorg.junit.jupiter
as the group ID.getId()
Get the ID that uniquely identifies this test engine.Methods inherited from class org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine
execute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.platform.engine.TestEngine
getVersion
-
Constructor Details
-
JupiterTestEngine
public JupiterTestEngine()
-
-
Method Details
-
getId
Description copied from interface:TestEngine
Get the ID that uniquely identifies this test engine.Each 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 customTestEngine
implementation class.- Returns:
- the ID of this test engine; never
null
or blank
-
getGroupId
Returnsorg.junit.jupiter
as the group ID.- Returns:
- an
Optional
containing the group ID; nevernull
but potentially empty if the group ID is unknown - See Also:
-
getArtifactId
Returnsjunit-jupiter-engine
as the artifact ID.- Returns:
- an
Optional
containing the artifact ID; nevernull
but potentially empty if the artifact ID is unknown - See Also:
-
discover
Description copied from interface:TestEngine
Discover tests according to the suppliedEngineDiscoveryRequest
.The supplied
UniqueId
must be used as the unique ID of the returned rootTestDescriptor
. In addition, theUniqueId
must be used to create unique IDs for children of the root's descriptor by callingUniqueId.append(java.lang.String, java.lang.String)
.- Parameters:
discoveryRequest
- the discovery request; nevernull
uniqueId
- the unique ID to be used for this test engine'sTestDescriptor
; nevernull
- Returns:
- the root
TestDescriptor
of this engine, typically an instance ofEngineDescriptor
- See Also:
-
createExecutorService
Description copied from class:HierarchicalTestEngine
Create the executor service to use for executing the supplied request.An 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
.- Overrides:
createExecutorService
in classHierarchicalTestEngine<JupiterEngineExecutionContext>
- Parameters:
request
- the request about to be executed- See Also:
-
createExecutionContext
Description copied from class:HierarchicalTestEngine
Create the initial execution context for executing the supplied request.- Specified by:
createExecutionContext
in classHierarchicalTestEngine<JupiterEngineExecutionContext>
- Parameters:
request
- the request about to be executed- Returns:
- the initial context that will be passed to nodes in the hierarchy
-
createThrowableCollectorFactory
Description copied from class:HierarchicalTestEngine
Create the factory for creatingThrowableCollector
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
.- Overrides:
createThrowableCollectorFactory
in classHierarchicalTestEngine<JupiterEngineExecutionContext>
- Parameters:
request
- the request about to be executed- Since:
- 5.4
- See Also:
-