java.lang.Object
org.junit.platform.testkit.engine.ExecutionRecorder
- All Implemented Interfaces:
EngineExecutionListener
@API(status=MAINTAINED,
since="1.7")
public class ExecutionRecorder
extends Object
implements EngineExecutionListener
ExecutionRecorder
is an EngineExecutionListener
that records
data from every event that occurs during the engine execution lifecycle and
provides functionality for retrieving execution state via
EngineExecutionResults
.- Since:
- 1.4
- See Also:
-
Field Summary
Fields inherited from interface org.junit.platform.engine.EngineExecutionListener
NOOP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dynamicTestRegistered
(TestDescriptor testDescriptor) Record anEvent
for a dynamically registered container or test.void
executionFinished
(TestDescriptor testDescriptor, TestExecutionResult testExecutionResult) Record anEvent
for a container or test that completed with the providedTestExecutionResult
.void
executionSkipped
(TestDescriptor testDescriptor, String reason) Record anEvent
for a container or test that was skipped.void
executionStarted
(TestDescriptor testDescriptor) Record anEvent
for a container or test that started.Get the state of the engine's execution in the form ofEngineExecutionResults
.void
reportingEntryPublished
(TestDescriptor testDescriptor, ReportEntry entry) Record anEvent
for a publishedReportEntry
.
-
Constructor Details
-
ExecutionRecorder
public ExecutionRecorder()
-
-
Method Details
-
dynamicTestRegistered
Record anEvent
for a dynamically registered container or test.- Specified by:
dynamicTestRegistered
in interfaceEngineExecutionListener
- Parameters:
testDescriptor
- the descriptor of the newly registered test or container
-
executionSkipped
Record anEvent
for a container or test that was skipped.- Specified by:
executionSkipped
in interfaceEngineExecutionListener
- Parameters:
testDescriptor
- the descriptor of the skipped test or containerreason
- a human-readable message describing why the execution has been skipped
-
executionStarted
Record anEvent
for a container or test that started.- Specified by:
executionStarted
in interfaceEngineExecutionListener
- Parameters:
testDescriptor
- the descriptor of the started test or container
-
executionFinished
public void executionFinished(TestDescriptor testDescriptor, TestExecutionResult testExecutionResult) Record anEvent
for a container or test that completed with the providedTestExecutionResult
.- Specified by:
executionFinished
in interfaceEngineExecutionListener
- Parameters:
testDescriptor
- the descriptor of the finished test or containertestExecutionResult
- the (unaggregated) result of the execution for the suppliedTestDescriptor
- See Also:
-
reportingEntryPublished
Record anEvent
for a publishedReportEntry
.- Specified by:
reportingEntryPublished
in interfaceEngineExecutionListener
- Parameters:
testDescriptor
- the descriptor of the test or container to which the reporting entry belongsentry
- aReportEntry
instance to be published
-
getExecutionResults
Get the state of the engine's execution in the form ofEngineExecutionResults
.- Returns:
- the
EngineExecutionResults
containing all current state information
-