Class RunListenerAdapter

java.lang.Object
org.apache.maven.surefire.junitplatform.RunListenerAdapter
All Implemented Interfaces:
org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>, org.apache.maven.surefire.report.RunModeSetter, org.junit.platform.launcher.TestExecutionListener

final class RunListenerAdapter extends Object implements org.junit.platform.launcher.TestExecutionListener, org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>, org.apache.maven.surefire.report.RunModeSetter
Since:
2.22.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.apache.maven.surefire.report.ClassMethodIndexer
     
    private final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult>
     
    private final org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry>
     
    private org.apache.maven.surefire.api.report.RunMode
     
    private final ConcurrentMap<String,org.junit.platform.launcher.TestIdentifier>
     
    private org.junit.platform.launcher.TestPlan
     
    private final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,Long>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RunListenerAdapter(org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> runListener)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private Stream<org.junit.platform.launcher.TestIdentifier>
    collectAllTestIdentifiersInHierarchy(org.junit.platform.launcher.TestIdentifier testIdentifier)
     
    private Integer
    computeElapsedTime(org.junit.platform.launcher.TestIdentifier testIdentifier)
     
    private org.apache.maven.surefire.api.report.SimpleReportEntry
    createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier)
     
    private org.apache.maven.surefire.api.report.SimpleReportEntry
    createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Integer elapsedTime)
     
    private org.apache.maven.surefire.api.report.SimpleReportEntry
    createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, String reason, Integer elapsedTime)
     
    private org.apache.maven.surefire.api.report.SimpleReportEntry
    createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Map<String,String> systemProperties, String reason, Integer elapsedTime)
     
    void
    executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult)
     
    void
    executionSkipped(org.junit.platform.launcher.TestIdentifier testIdentifier, String reason)
     
    void
    executionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier)
     
    (package private) Map<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult>
     
    (package private) boolean
     
    (package private) void
     
    private String
     
    void
    setRunMode(org.apache.maven.surefire.api.report.RunMode runMode)
     
    void
    testPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan)
     
    void
    testPlanExecutionStarted(org.junit.platform.launcher.TestPlan testPlan)
     
    private String[]
    toClassMethodName(org.junit.platform.launcher.TestIdentifier testIdentifier)
    [0] class name - used in stacktrace parser [1] class display name [2] method signature - used in stacktrace parser [3] method display name
    private org.apache.maven.surefire.api.report.StackTraceWriter
    toStackTraceWriter(String realClassName, String realMethodName, Throwable throwable)
     
    private org.apache.maven.surefire.api.report.StackTraceWriter
    toStackTraceWriter(String realClassName, String realMethodName, org.junit.platform.engine.TestExecutionResult testExecutionResult)
     
    void
    writeTestOutput(org.apache.maven.surefire.api.report.OutputReportEntry reportEntry)
     

    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, reportingEntryPublished
  • Field Details

    • classMethodIndexer

      private final org.apache.maven.surefire.report.ClassMethodIndexer classMethodIndexer
    • testStartTime

      private final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,Long> testStartTime
    • failures

      private final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult> failures
    • runningTestIdentifiersByUniqueId

      private final ConcurrentMap<String,org.junit.platform.launcher.TestIdentifier> runningTestIdentifiersByUniqueId
    • runListener

      private final org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> runListener
    • testPlan

      private volatile org.junit.platform.launcher.TestPlan testPlan
    • runMode

      private volatile org.apache.maven.surefire.api.report.RunMode runMode
  • Constructor Details

    • RunListenerAdapter

      RunListenerAdapter(org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> runListener)
  • Method Details

    • setRunMode

      public void setRunMode(org.apache.maven.surefire.api.report.RunMode runMode)
      Specified by:
      setRunMode in interface org.apache.maven.surefire.report.RunModeSetter
    • testPlanExecutionStarted

      public void testPlanExecutionStarted(org.junit.platform.launcher.TestPlan testPlan)
      Specified by:
      testPlanExecutionStarted in interface org.junit.platform.launcher.TestExecutionListener
    • testPlanExecutionFinished

      public void testPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan)
      Specified by:
      testPlanExecutionFinished in interface org.junit.platform.launcher.TestExecutionListener
    • executionStarted

      public void executionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier)
      Specified by:
      executionStarted in interface org.junit.platform.launcher.TestExecutionListener
    • executionFinished

      public void executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult)
      Specified by:
      executionFinished in interface org.junit.platform.launcher.TestExecutionListener
    • computeElapsedTime

      private Integer computeElapsedTime(org.junit.platform.launcher.TestIdentifier testIdentifier)
    • collectAllTestIdentifiersInHierarchy

      private Stream<org.junit.platform.launcher.TestIdentifier> collectAllTestIdentifiersInHierarchy(org.junit.platform.launcher.TestIdentifier testIdentifier)
    • safeGetMessage

      private String safeGetMessage(Throwable throwable)
    • executionSkipped

      public void executionSkipped(org.junit.platform.launcher.TestIdentifier testIdentifier, String reason)
      Specified by:
      executionSkipped in interface org.junit.platform.launcher.TestExecutionListener
    • createReportEntry

      private org.apache.maven.surefire.api.report.SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Map<String,String> systemProperties, String reason, Integer elapsedTime)
    • createReportEntry

      private org.apache.maven.surefire.api.report.SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier)
    • createReportEntry

      private org.apache.maven.surefire.api.report.SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Integer elapsedTime)
    • createReportEntry

      private org.apache.maven.surefire.api.report.SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, String reason, Integer elapsedTime)
    • toStackTraceWriter

      private org.apache.maven.surefire.api.report.StackTraceWriter toStackTraceWriter(String realClassName, String realMethodName, org.junit.platform.engine.TestExecutionResult testExecutionResult)
    • toStackTraceWriter

      private org.apache.maven.surefire.api.report.StackTraceWriter toStackTraceWriter(String realClassName, String realMethodName, Throwable throwable)
    • toClassMethodName

      private String[] toClassMethodName(org.junit.platform.launcher.TestIdentifier testIdentifier)
      • [0] class name - used in stacktrace parser
      • [1] class display name
      • [2] method signature - used in stacktrace parser
      • [3] method display name
      Parameters:
      testIdentifier - a class or method
      Returns:
      4 elements string array
    • getFailures

      Map<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult> getFailures()
      Returns:
      Map of tests that failed.
    • hasFailingTests

      boolean hasFailingTests()
    • reset

      void reset()
    • writeTestOutput

      public void writeTestOutput(org.apache.maven.surefire.api.report.OutputReportEntry reportEntry)
      Specified by:
      writeTestOutput in interface org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>