Class OpenTestReportGeneratingListener
- java.lang.Object
-
- org.junit.platform.reporting.open.xml.OpenTestReportGeneratingListener
-
- All Implemented Interfaces:
TestExecutionListener
@API(status=EXPERIMENTAL, since="1.9") public class OpenTestReportGeneratingListener extends java.lang.Object implements TestExecutionListenerOpen Test Reporting events XML generating test execution listener.- Since:
- 1.9
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringENABLED_PROPERTY_NAMEprivate org.opentest4j.reporting.events.api.DocumentWriter<org.opentest4j.reporting.events.root.Events>eventsFileWriterprivate java.util.concurrent.atomic.AtomicIntegeridCounterprivate java.util.Map<UniqueId,java.lang.String>inProgressIds(package private) static java.lang.StringOUTPUT_DIR_PROPERTY_NAME
-
Constructor Summary
Constructors Constructor Description OpenTestReportGeneratingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddTestSource(TestSource source, org.opentest4j.reporting.events.core.Sources sources)private org.opentest4j.reporting.events.core.Result.StatusconvertStatus(TestExecutionResult.Status status)voidexecutionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult)Called when the execution of a leaf or subtree of theTestPlanhas finished, regardless of the outcome.voidexecutionSkipped(TestIdentifier testIdentifier, java.lang.String reason)Called when the execution of a leaf or subtree of theTestPlanhas been skipped.voidexecutionStarted(TestIdentifier testIdentifier)Called when the execution of a leaf or subtree of theTestPlanis about to be started.private java.lang.BooleanisEnabled(ConfigurationParameters config)private voidreportInfrastructure()voidreportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry)Called when additional test reporting data has been published for the suppliedTestIdentifier.private voidreportStarted(TestIdentifier testIdentifier, java.lang.String id)voidtestPlanExecutionFinished(TestPlan testPlan)Called when the execution of theTestPlanhas finished, after all tests have been executed.voidtestPlanExecutionStarted(TestPlan testPlan)Called when the execution of theTestPlanhas started, before any test has been executed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.junit.platform.launcher.TestExecutionListener
dynamicTestRegistered
-
-
-
-
Field Detail
-
ENABLED_PROPERTY_NAME
static final java.lang.String ENABLED_PROPERTY_NAME
- See Also:
- Constant Field Values
-
OUTPUT_DIR_PROPERTY_NAME
static final java.lang.String OUTPUT_DIR_PROPERTY_NAME
- See Also:
- Constant Field Values
-
idCounter
private final java.util.concurrent.atomic.AtomicInteger idCounter
-
inProgressIds
private final java.util.Map<UniqueId,java.lang.String> inProgressIds
-
eventsFileWriter
private org.opentest4j.reporting.events.api.DocumentWriter<org.opentest4j.reporting.events.root.Events> eventsFileWriter
-
-
Method Detail
-
testPlanExecutionStarted
public void testPlanExecutionStarted(TestPlan testPlan)
Description copied from interface:TestExecutionListenerCalled when the execution of theTestPlanhas started, before any test has been executed.Called from the same thread as
TestExecutionListener.testPlanExecutionFinished(TestPlan).- Specified by:
testPlanExecutionStartedin interfaceTestExecutionListener- Parameters:
testPlan- describes the tree of tests about to be executed
-
isEnabled
private java.lang.Boolean isEnabled(ConfigurationParameters config)
-
reportInfrastructure
private void reportInfrastructure()
-
testPlanExecutionFinished
public void testPlanExecutionFinished(TestPlan testPlan)
Description copied from interface:TestExecutionListenerCalled when the execution of theTestPlanhas finished, after all tests have been executed.Called from the same thread as
TestExecutionListener.testPlanExecutionStarted(TestPlan).- Specified by:
testPlanExecutionFinishedin interfaceTestExecutionListener- Parameters:
testPlan- describes the tree of tests that have been executed
-
executionSkipped
public void executionSkipped(TestIdentifier testIdentifier, java.lang.String reason)
Description copied from interface:TestExecutionListenerCalled when the execution of a leaf or subtree of theTestPlanhas been skipped.The
TestIdentifiermay 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.
- Specified by:
executionSkippedin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the skipped test or containerreason- a human-readable message describing why the execution has been skipped
-
executionStarted
public void executionStarted(TestIdentifier testIdentifier)
Description copied from interface:TestExecutionListenerCalled when the execution of a leaf or subtree of theTestPlanis about to be started.The
TestIdentifiermay 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
TestIdentifierbefore starting or skipping any of its children.- Specified by:
executionStartedin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the started test or container
-
reportStarted
private void reportStarted(TestIdentifier testIdentifier, java.lang.String id)
-
addTestSource
private void addTestSource(TestSource source, org.opentest4j.reporting.events.core.Sources sources)
-
reportingEntryPublished
public void reportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry)
Description copied from interface:TestExecutionListenerCalled when additional test reporting data has been published for the suppliedTestIdentifier.Can be called at any time during the execution of a test plan.
- Specified by:
reportingEntryPublishedin interfaceTestExecutionListener- Parameters:
testIdentifier- describes the test or container to which the entry pertainsentry- the publishedReportEntry
-
executionFinished
public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult)
Description copied from interface:TestExecutionListenerCalled when the execution of a leaf or subtree of theTestPlanhas finished, regardless of the outcome.The
TestIdentifiermay 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
TestIdentifierafter all of its children have been skipped or have finished.The
TestExecutionResultdescribes the result of the execution for the suppliedTestIdentifier. The result does not include or aggregate the results of its children. For example, a container with a failing test will be reported asSUCCESSFULeven if one or more of its children are reported asFAILED.- Specified by:
executionFinishedin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the finished test or containertestExecutionResult- the (unaggregated) result of the execution for the suppliedTestIdentifier- See Also:
TestExecutionResult
-
convertStatus
private org.opentest4j.reporting.events.core.Result.Status convertStatus(TestExecutionResult.Status status)
-
-