Class ExecutionRecorder

java.lang.Object
org.junit.platform.testkit.engine.ExecutionRecorder
All Implemented Interfaces:
org.junit.platform.engine.EngineExecutionListener

@API(status=MAINTAINED, since="1.7") public class ExecutionRecorder extends Object implements org.junit.platform.engine.EngineExecutionListener
ExecutionRecorder is an EngineExecutionListener that records data from every event that occurs during the engine execution lifecycle and provides functionality for retrieving execution state via EngineExecutionResults.
Since:
1.4
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final List<Event>
     

    Fields inherited from interface org.junit.platform.engine.EngineExecutionListener

    NOOP
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dynamicTestRegistered(org.junit.platform.engine.TestDescriptor testDescriptor)
    Record an Event for a dynamically registered container or test.
    void
    executionFinished(org.junit.platform.engine.TestDescriptor testDescriptor, org.junit.platform.engine.TestExecutionResult testExecutionResult)
    Record an Event for a container or test that completed with the provided TestExecutionResult.
    void
    executionSkipped(org.junit.platform.engine.TestDescriptor testDescriptor, String reason)
    Record an Event for a container or test that was skipped.
    void
    executionStarted(org.junit.platform.engine.TestDescriptor testDescriptor)
    Record an Event for a container or test that started.
    void
    fileEntryPublished(org.junit.platform.engine.TestDescriptor testDescriptor, org.junit.platform.engine.reporting.FileEntry file)
    Record an Event for a published FileEntry.
    Get the state of the engine's execution in the form of EngineExecutionResults.
    void
    reportingEntryPublished(org.junit.platform.engine.TestDescriptor testDescriptor, org.junit.platform.engine.reporting.ReportEntry entry)
    Record an Event for a published ReportEntry.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ExecutionRecorder

      public ExecutionRecorder()
  • Method Details

    • dynamicTestRegistered

      public void dynamicTestRegistered(org.junit.platform.engine.TestDescriptor testDescriptor)
      Record an Event for a dynamically registered container or test.
      Specified by:
      dynamicTestRegistered in interface org.junit.platform.engine.EngineExecutionListener
    • executionSkipped

      public void executionSkipped(org.junit.platform.engine.TestDescriptor testDescriptor, String reason)
      Record an Event for a container or test that was skipped.
      Specified by:
      executionSkipped in interface org.junit.platform.engine.EngineExecutionListener
    • executionStarted

      public void executionStarted(org.junit.platform.engine.TestDescriptor testDescriptor)
      Record an Event for a container or test that started.
      Specified by:
      executionStarted in interface org.junit.platform.engine.EngineExecutionListener
    • executionFinished

      public void executionFinished(org.junit.platform.engine.TestDescriptor testDescriptor, org.junit.platform.engine.TestExecutionResult testExecutionResult)
      Record an Event for a container or test that completed with the provided TestExecutionResult.
      Specified by:
      executionFinished in interface org.junit.platform.engine.EngineExecutionListener
    • reportingEntryPublished

      public void reportingEntryPublished(org.junit.platform.engine.TestDescriptor testDescriptor, org.junit.platform.engine.reporting.ReportEntry entry)
      Record an Event for a published ReportEntry.
      Specified by:
      reportingEntryPublished in interface org.junit.platform.engine.EngineExecutionListener
    • fileEntryPublished

      @API(status=MAINTAINED, since="1.13.3") public void fileEntryPublished(org.junit.platform.engine.TestDescriptor testDescriptor, org.junit.platform.engine.reporting.FileEntry file)
      Record an Event for a published FileEntry.
      Specified by:
      fileEntryPublished in interface org.junit.platform.engine.EngineExecutionListener
      Since:
      1.12
    • getExecutionResults

      public EngineExecutionResults getExecutionResults()
      Get the state of the engine's execution in the form of EngineExecutionResults.
      Returns:
      the EngineExecutionResults containing all current state information