Class LegacyXmlReportGeneratingListener

java.lang.Object
org.junit.platform.reporting.legacy.xml.LegacyXmlReportGeneratingListener
All Implemented Interfaces:
TestExecutionListener

@API(status=STABLE, since="1.7") public class LegacyXmlReportGeneratingListener extends Object implements TestExecutionListener
LegacyXmlReportGeneratingListener is a TestExecutionListener that generates a separate XML report for each root in the TestPlan.

Note that the generated XML format is compatible with the legacy de facto standard for JUnit 4 based test reports that was made popular by the Ant build system.

Since:
1.4
See Also:
  • Constructor Details

    • LegacyXmlReportGeneratingListener

      public LegacyXmlReportGeneratingListener(Path reportsDir, PrintWriter out)
  • Method Details

    • testPlanExecutionStarted

      public void testPlanExecutionStarted(TestPlan testPlan)
      Description copied from interface: TestExecutionListener
      Called when the execution of the TestPlan has started, before any test has been executed.
      Specified by:
      testPlanExecutionStarted in interface TestExecutionListener
      Parameters:
      testPlan - describes the tree of tests about to be executed
    • testPlanExecutionFinished

      public void testPlanExecutionFinished(TestPlan testPlan)
      Description copied from interface: TestExecutionListener
      Called when the execution of the TestPlan has finished, after all tests have been executed.
      Specified by:
      testPlanExecutionFinished in interface TestExecutionListener
      Parameters:
      testPlan - describes the tree of tests that have been executed
    • executionSkipped

      public void executionSkipped(TestIdentifier testIdentifier, String reason)
      Description copied from interface: TestExecutionListener
      Called when the execution of a leaf or subtree of the 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.

      Specified by:
      executionSkipped in interface TestExecutionListener
      Parameters:
      testIdentifier - the identifier of the skipped test or container
      reason - a human-readable message describing why the execution has been skipped
    • executionStarted

      public void executionStarted(TestIdentifier testIdentifier)
      Description copied from interface: TestExecutionListener
      Called when the execution of a leaf or subtree of the 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.

      Specified by:
      executionStarted in interface TestExecutionListener
      Parameters:
      testIdentifier - the identifier of the started test or container
    • reportingEntryPublished

      public void reportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry)
      Description copied from interface: TestExecutionListener
      Called when additional test reporting data has been published for the supplied TestIdentifier.

      Can be called at any time during the execution of a test plan.

      Specified by:
      reportingEntryPublished in interface TestExecutionListener
      Parameters:
      testIdentifier - describes the test or container to which the entry pertains
      entry - the published ReportEntry
    • executionFinished

      public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult result)
      Description copied from interface: TestExecutionListener
      Called when the execution of a leaf or subtree of the 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.

      Specified by:
      executionFinished in interface TestExecutionListener
      Parameters:
      testIdentifier - the identifier of the finished test or container
      result - the (unaggregated) result of the execution for the supplied TestIdentifier
      See Also: