Class OutcomeDelayingEngineExecutionListener
- java.lang.Object
-
- org.junit.platform.launcher.core.DelegatingEngineExecutionListener
-
- org.junit.platform.launcher.core.OutcomeDelayingEngineExecutionListener
-
- All Implemented Interfaces:
EngineExecutionListener
class OutcomeDelayingEngineExecutionListener extends DelegatingEngineExecutionListener
Delays reporting of engine skipped/finished events so that exceptions thrown by engines can be reported to listeners.- Since:
- 1.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOutcomeDelayingEngineExecutionListener.Outcome
-
Field Summary
Fields Modifier and Type Field Description private TestDescriptorengineDescriptorprivate booleanengineStartedprivate TestExecutionResultexecutionResultprivate OutcomeDelayingEngineExecutionListener.Outcomeoutcomeprivate java.lang.StringskipReason-
Fields inherited from interface org.junit.platform.engine.EngineExecutionListener
NOOP
-
-
Constructor Summary
Constructors Constructor Description OutcomeDelayingEngineExecutionListener(EngineExecutionListener delegate, TestDescriptor engineDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecutionFinished(TestDescriptor testDescriptor, TestExecutionResult executionResult)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.(package private) voidreportEngineFailure(java.lang.Throwable throwable)(package private) voidreportEngineOutcome()(package private) voidreportEngineStartIfNecessary()-
Methods inherited from class org.junit.platform.launcher.core.DelegatingEngineExecutionListener
dynamicTestRegistered, fileEntryPublished, reportingEntryPublished
-
-
-
-
Field Detail
-
engineDescriptor
private final TestDescriptor engineDescriptor
-
engineStarted
private volatile boolean engineStarted
-
outcome
private volatile OutcomeDelayingEngineExecutionListener.Outcome outcome
-
skipReason
private volatile java.lang.String skipReason
-
executionResult
private volatile TestExecutionResult executionResult
-
-
Constructor Detail
-
OutcomeDelayingEngineExecutionListener
OutcomeDelayingEngineExecutionListener(EngineExecutionListener delegate, TestDescriptor engineDescriptor)
-
-
Method Detail
-
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- Overrides:
executionSkippedin classDelegatingEngineExecutionListener- 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- Overrides:
executionStartedin classDelegatingEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the started test or container
-
executionFinished
public void executionFinished(TestDescriptor testDescriptor, TestExecutionResult executionResult)
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- Overrides:
executionFinishedin classDelegatingEngineExecutionListener- Parameters:
testDescriptor- the descriptor of the finished test or containerexecutionResult- the (unaggregated) result of the execution for the suppliedTestDescriptor- See Also:
TestExecutionResult
-
reportEngineOutcome
void reportEngineOutcome()
-
reportEngineStartIfNecessary
void reportEngineStartIfNecessary()
-
reportEngineFailure
void reportEngineFailure(java.lang.Throwable throwable)
-
-