final class RunListenerAdapter extends java.lang.Object implements TestExecutionListener
Modifier and Type | Field and Description |
---|---|
private org.apache.maven.surefire.report.RunListener |
runListener |
private java.util.Optional<TestPlan> |
testPlan |
Constructor and Description |
---|
RunListenerAdapter(org.apache.maven.surefire.report.RunListener runListener) |
Modifier and Type | Method and Description |
---|---|
private org.apache.maven.surefire.report.SimpleReportEntry |
createReportEntry(TestIdentifier testIdentifier,
java.util.Optional<java.lang.Throwable> throwable) |
void |
executionFinished(TestIdentifier testIdentifier,
TestExecutionResult testExecutionResult)
Called when the execution of a leaf or subtree of the
TestPlan
has finished, regardless of the outcome. |
void |
executionSkipped(TestIdentifier testIdentifier,
java.lang.String reason)
Called when the execution of a leaf or subtree of the
TestPlan
has been skipped. |
void |
executionStarted(TestIdentifier testIdentifier)
Called when the execution of a leaf or subtree of the
TestPlan
is about to be started. |
private java.util.Optional<java.lang.String> |
getClassName(TestIdentifier testIdentifier) |
private java.util.Optional<java.lang.String> |
getMethodName(TestIdentifier testIdentifier) |
private void |
reportFailedTest(TestIdentifier testIdentifier,
java.util.Optional<java.lang.Throwable> throwable) |
private java.lang.String |
sourceLegacyReportingName(TestIdentifier testIdentifier) |
void |
testPlanExecutionFinished(TestPlan testPlan)
Called when the execution of the
TestPlan has finished,
after all tests have been executed. |
void |
testPlanExecutionStarted(TestPlan testPlan)
Called when the execution of the
TestPlan has started,
before any test has been executed. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dynamicTestRegistered, reportingEntryPublished
private final org.apache.maven.surefire.report.RunListener runListener
private java.util.Optional<TestPlan> testPlan
public RunListenerAdapter(org.apache.maven.surefire.report.RunListener runListener)
public void testPlanExecutionStarted(TestPlan testPlan)
TestExecutionListener
TestPlan
has started,
before any test has been executed.testPlanExecutionStarted
in interface TestExecutionListener
testPlan
- describes the tree of tests about to be executedpublic void testPlanExecutionFinished(TestPlan testPlan)
TestExecutionListener
TestPlan
has finished,
after all tests have been executed.testPlanExecutionFinished
in interface TestExecutionListener
testPlan
- describes the tree of tests that have been executedpublic void executionStarted(TestIdentifier testIdentifier)
TestExecutionListener
TestPlan
is about to be started.
The TestIdentifier
may represent a test or a container.
This method will only be called if the test or container has not been skipped.
This method will be called for a container TestIdentifier
before starting or
skipping any of its children.
executionStarted
in interface TestExecutionListener
testIdentifier
- the identifier of the started test or containerpublic void executionSkipped(TestIdentifier testIdentifier, java.lang.String reason)
TestExecutionListener
TestPlan
has been skipped.
The TestIdentifier
may represent a test or a container. In
the case of a container, no listener methods will be called for any of
its descendants.
A skipped test or subtree of tests will never be reported as started or finished.
executionSkipped
in interface TestExecutionListener
testIdentifier
- the identifier of the skipped test or containerreason
- a human-readable message describing why the execution
has been skippedpublic void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult)
TestExecutionListener
TestPlan
has finished, regardless of the outcome.
The TestIdentifier
may represent a test or a container.
This method will only be called if the test or container has not been skipped.
This method will be called for a container TestIdentifier
after all of its children have been
skipped or have
finished.
The TestExecutionResult
describes the result of the execution
for the supplied TestIdentifier
. The result does not include or
aggregate the results of its children. For example, a container with a
failing test will be reported as SUCCESSFUL
even
if one or more of its children are reported as FAILED
.
executionFinished
in interface TestExecutionListener
testIdentifier
- the identifier of the finished test or containertestExecutionResult
- the (unaggregated) result of the execution for
the supplied TestIdentifier
TestExecutionResult
private void reportFailedTest(TestIdentifier testIdentifier, java.util.Optional<java.lang.Throwable> throwable)
private org.apache.maven.surefire.report.SimpleReportEntry createReportEntry(TestIdentifier testIdentifier, java.util.Optional<java.lang.Throwable> throwable)
private java.lang.String sourceLegacyReportingName(TestIdentifier testIdentifier)
private java.util.Optional<java.lang.String> getClassName(TestIdentifier testIdentifier)
private java.util.Optional<java.lang.String> getMethodName(TestIdentifier testIdentifier)