@API(value=Experimental) public interface TestEngine
TestEngine
facilitates discovery and execution of
tests for a particular programming model.
For example, JUnit provides a TestEngine
that discovers and
executes tests written using the JUnit Jupiter programming model.
Every TestEngine
must provide an ID,
discover tests from
EngineDiscoveryRequests
,
and execute them according to
ExecutionRequests
.
EngineDiscoveryRequest
,
ExecutionRequest
Modifier and Type | Method and Description |
---|---|
TestDescriptor |
discover(EngineDiscoveryRequest discoveryRequest,
UniqueId uniqueId)
Discover tests according to the supplied
EngineDiscoveryRequest . |
void |
execute(ExecutionRequest request)
Execute tests according to the supplied
ExecutionRequest . |
java.lang.String |
getId()
Get the ID that uniquely identifies this test engine.
|
java.lang.String getId()
Each test engine must provide a unique ID. JUnit Vintage and Jupiter
use "junit-vintage"
and "junit-jupiter"
, respectively.
When in doubt, you may use the fully qualified name of your custom
TestEngine
implementation class.
TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId)
EngineDiscoveryRequest
.
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 requestuniqueId
- the unique ID to be used for this test engine's
TestDescriptor
TestDescriptor
of this engine, typically an
instance of EngineDescriptor
EngineDescriptor
void execute(ExecutionRequest request)
ExecutionRequest
.
The request
passed to this method contains the root
TestDescriptor
that was previously returned by discover(org.junit.platform.engine.EngineDiscoveryRequest, org.junit.platform.engine.UniqueId)
,
the EngineExecutionListener
to be notified of test execution
events, and ConfigurationParameters
that may influence test execution.
request
- the request to execute tests for