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 JupiterEngineExecutionContextcreateExecutionContext(ExecutionRequest request)Create the initial execution context for executing the supplied request.protected HierarchicalTestExecutorServicecreateExecutorService(ExecutionRequest request)Create the executor service to use for executing the supplied request.TestDescriptordiscover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId)Discover tests according to the suppliedEngineDiscoveryRequest.Optional<String>getArtifactId()Returnsjunit-jupiter-engineas the artifact ID.Optional<String>getGroupId()Returnsorg.junit.jupiteras the group ID.StringgetId()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:TestEngineGet 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 customTestEngineimplementation class.
-
getGroupId
public Optional<String> getGroupId()
Returnsorg.junit.jupiteras the group ID.- Returns:
- an
Optionalcontaining the group ID; nevernullbut potentially empty if the group ID is unknown - See Also:
TestEngine.getArtifactId(),TestEngine.getVersion()
-
getArtifactId
public Optional<String> getArtifactId()
Returnsjunit-jupiter-engineas the artifact ID.- Returns:
- an
Optionalcontaining the artifact ID; nevernullbut 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:TestEngineDiscover tests according to the suppliedEngineDiscoveryRequest.The supplied
UniqueIdmust be used as the unique ID of the returned rootTestDescriptor. In addition, theUniqueIdmust 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; nevernulluniqueId- the unique ID to be used for this test engine'sTestDescriptor; nevernull- Returns:
- the root
TestDescriptorof this engine, typically an instance ofEngineDescriptor - See Also:
EngineDescriptor
-
createExecutorService
protected HierarchicalTestExecutorService createExecutorService(ExecutionRequest request)
Description copied from class:HierarchicalTestEngineCreate 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:
createExecutorServicein classHierarchicalTestEngine<JupiterEngineExecutionContext>- Parameters:
request- the request about to be executed- See Also:
ForkJoinPoolHierarchicalTestExecutorService,SameThreadHierarchicalTestExecutorService
-
createExecutionContext
protected JupiterEngineExecutionContext createExecutionContext(ExecutionRequest request)
Description copied from class:HierarchicalTestEngineCreate the initial execution context for executing the supplied request.- Specified by:
createExecutionContextin classHierarchicalTestEngine<JupiterEngineExecutionContext>- Parameters:
request- the request about to be executed- Returns:
- the initial context that will be passed to nodes in the hierarchy
-
-