Class ExecutionRecorder
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 EngineExecutionListener
NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddynamicTestRegistered(TestDescriptor testDescriptor) Record anEventfor a dynamically registered container or test.voidexecutionFinished(TestDescriptor testDescriptor, TestExecutionResult testExecutionResult) Record anEventfor a container or test that completed with the providedTestExecutionResult.voidexecutionSkipped(TestDescriptor testDescriptor, String reason) Record anEventfor a container or test that was skipped.voidexecutionStarted(TestDescriptor testDescriptor) Record anEventfor a container or test that started.voidfileEntryPublished(TestDescriptor testDescriptor, FileEntry file) Get the state of the engine's execution in the form ofEngineExecutionResults.voidreportingEntryPublished(TestDescriptor testDescriptor, ReportEntry entry) Record anEventfor a publishedReportEntry.
-
Constructor Details
-
ExecutionRecorder
public ExecutionRecorder()
-
-
Method Details
-
dynamicTestRegistered
Record anEventfor a dynamically registered container or test.- Specified by:
dynamicTestRegisteredin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the newly registered test or container
-
executionSkipped
Record anEventfor a container or test that was skipped.- Specified by:
executionSkippedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the skipped test or containerreason- a human-readable message describing why the execution has been skipped
-
executionStarted
Record anEventfor a container or test that started.- Specified by:
executionStartedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the started test or container
-
executionFinished
public void executionFinished(TestDescriptor testDescriptor, TestExecutionResult testExecutionResult) Record anEventfor a container or test that completed with the providedTestExecutionResult.- Specified by:
executionFinishedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the finished test or containertestExecutionResult- the (unaggregated) result of the execution for the suppliedTestDescriptor- See Also:
-
reportingEntryPublished
Record anEventfor a publishedReportEntry.- Specified by:
reportingEntryPublishedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the test or container to which the reporting entry belongsentry- theReportEntryto be published
-
fileEntryPublished
@API(status=MAINTAINED, since="1.13.3") public void fileEntryPublished(TestDescriptor testDescriptor, FileEntry file) - Specified by:
fileEntryPublishedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the test or container to which the file entry belongsfile- theFileEntryto be published- Since:
- 1.12
-
getExecutionResults
Get the state of the engine's execution in the form ofEngineExecutionResults.- Returns:
- the
EngineExecutionResultscontaining all current state information
-