Class CompositeEngineExecutionListener
- java.lang.Object
-
- org.junit.platform.launcher.core.CompositeEngineExecutionListener
-
- All Implemented Interfaces:
EngineExecutionListener
class CompositeEngineExecutionListener extends java.lang.Object implements EngineExecutionListener
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<EngineExecutionListener>engineExecutionListenersprivate static org.junit.platform.commons.logging.Loggerlogger-
Fields inherited from interface org.junit.platform.engine.EngineExecutionListener
NOOP
-
-
Constructor Summary
Constructors Constructor Description CompositeEngineExecutionListener(java.util.List<EngineExecutionListener> engineExecutionListeners)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddynamicTestRegistered(TestDescriptor testDescriptor)Must be called when a new, dynamicTestDescriptorhas been registered.voidexecutionFinished(TestDescriptor testDescriptor, TestExecutionResult testExecutionResult)Must be called when the execution of a leaf or subtree of the test tree has finished, regardless of the outcome.voidexecutionSkipped(TestDescriptor testDescriptor, java.lang.String reason)Must be called when the execution of a leaf or subtree of the test tree has been skipped.voidexecutionStarted(TestDescriptor testDescriptor)Must be called when the execution of a leaf or subtree of the test tree is about to be started.voidfileEntryPublished(TestDescriptor testDescriptor, FileEntry file)Can be called for anyTestDescriptorin order to publish a file or directory by attaching it to a test or container — for example: Screenshots Logs Output files written by the code under test Test output directoryprivate static <T extends EngineExecutionListener>
voidnotifyEach(java.util.List<T> listeners, IterationOrder iterationOrder, java.util.function.Consumer<T> consumer, java.util.function.Supplier<java.lang.String> description)voidreportingEntryPublished(TestDescriptor testDescriptor, ReportEntry entry)Can be called for anyTestDescriptorin order to publish additional information to the reporting infrastructure — for example: Output that would otherwise go toSystem.outInformation about test context or test data
-
-
-
Field Detail
-
logger
private static final org.junit.platform.commons.logging.Logger logger
-
engineExecutionListeners
private final java.util.List<EngineExecutionListener> engineExecutionListeners
-
-
Constructor Detail
-
CompositeEngineExecutionListener
CompositeEngineExecutionListener(java.util.List<EngineExecutionListener> engineExecutionListeners)
-
-
Method Detail
-
dynamicTestRegistered
public void dynamicTestRegistered(TestDescriptor testDescriptor)
Description copied from interface:EngineExecutionListenerMust be called when a new, dynamicTestDescriptorhas been registered.A dynamic test is a test that is not known a-priori and therefore was not present in the test tree when discovering tests.
- Specified by:
dynamicTestRegisteredin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the newly registered test or container
-
executionSkipped
public void executionSkipped(TestDescriptor testDescriptor, java.lang.String reason)
Description copied from interface:EngineExecutionListenerMust be called when the execution of a leaf or subtree of the test tree has been skipped.The
TestDescriptormay represent a test or a container. In the case of a container, an engine must not fire any additional events for its descendants.A skipped test or subtree of tests must not be reported as started or finished.
- 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
public void executionStarted(TestDescriptor testDescriptor)
Description copied from interface:EngineExecutionListenerMust be called when the execution of a leaf or subtree of the test tree is about to be started.The
TestDescriptormay represent a test or a container. In the case of a container, an engine must fire additional events for its children.This method may only be called if the test or container has not been skipped.
This method must be called for a container
TestDescriptorbefore starting or skipping any of its children.- Specified by:
executionStartedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the started test or container
-
executionFinished
public void executionFinished(TestDescriptor testDescriptor, TestExecutionResult testExecutionResult)
Description copied from interface:EngineExecutionListenerMust be called when the execution of a leaf or subtree of the test tree has finished, regardless of the outcome.The
TestDescriptormay represent a test or a container.This method may only be called if the test or container has not been skipped.
This method must be called for a container
TestIdentifierafter all of its children have been skipped or have finished.The
TestExecutionResultdescribes the result of the execution for the suppliedtestDescriptor. The result does not include or aggregate the results of its children. For example, a container with a failing test must be reported asSUCCESSFULeven if one or more of its children are reported asFAILED.- 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:
TestExecutionResult
-
reportingEntryPublished
public void reportingEntryPublished(TestDescriptor testDescriptor, ReportEntry entry)
Description copied from interface:EngineExecutionListenerCan be called for anyTestDescriptorin order to publish additional information to the reporting infrastructure — for example:- Output that would otherwise go to
System.out - Information about test context or test data
The current lifecycle state of the supplied
TestDescriptoris not relevant: reporting events can occur at any time.- Specified by:
reportingEntryPublishedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the test or container to which the reporting entry belongsentry- theReportEntryto be published
- Output that would otherwise go to
-
fileEntryPublished
public void fileEntryPublished(TestDescriptor testDescriptor, FileEntry file)
Description copied from interface:EngineExecutionListenerCan be called for anyTestDescriptorin order to publish a file or directory by attaching it to a test or container — for example:- Screenshots
- Logs
- Output files written by the code under test
- Test output directory
The current lifecycle state of the supplied
TestDescriptoris not relevant: file events can occur at any time.- Specified by:
fileEntryPublishedin interfaceEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the test or container to which the file entry belongsfile- theFileEntryto be published
-
notifyEach
private static <T extends EngineExecutionListener> void notifyEach(java.util.List<T> listeners, IterationOrder iterationOrder, java.util.function.Consumer<T> consumer, java.util.function.Supplier<java.lang.String> description)
-
-