Package org.junit.jupiter.engine
Class JupiterTestEngine
- java.lang.Object
-
- org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine<JupiterEngineExecutionContext>
-
- org.junit.jupiter.engine.JupiterTestEngine
-
- All Implemented Interfaces:
TestEngine
@API(status=INTERNAL, since="5.0") public final class JupiterTestEngine extends HierarchicalTestEngine<JupiterEngineExecutionContext>
The JUnit JupiterTestEngine
.- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description JupiterTestEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JupiterEngineExecutionContext
createExecutionContext(ExecutionRequest request)
Create the initial execution context for executing the suppliedrequest
.TestDescriptor
discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId)
Discover tests according to the suppliedEngineDiscoveryRequest
.Optional<String>
getArtifactId()
Returnsjunit-jupiter-engine
as the artifact ID.Optional<String>
getGroupId()
Returnsorg.junit.jupiter
as the group ID.String
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
-
-
-
-
Field Detail
-
ENGINE_ID
public static final String ENGINE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public String 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.
-
getGroupId
public Optional<String> 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:
TestEngine.getArtifactId()
,TestEngine.getVersion()
-
getArtifactId
public Optional<String> 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:
Class.getPackage()
,Package.getImplementationTitle()
,TestEngine.getGroupId()
,TestEngine.getVersion()
-
discover
public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId)
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:
EngineDescriptor
-
createExecutionContext
protected JupiterEngineExecutionContext createExecutionContext(ExecutionRequest request)
Description copied from class:HierarchicalTestEngine
Create the initial execution context for executing the suppliedrequest
.- 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
-
-