Class ExecutionRecorder

  • All Implemented Interfaces:
    org.junit.platform.engine.EngineExecutionListener

    @API(status=MAINTAINED,
         since="1.7")
    public class ExecutionRecorder
    extends java.lang.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:
    EngineExecutionResults, Event, Execution
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<Event> events  
      • Fields inherited from interface org.junit.platform.engine.EngineExecutionListener

        NOOP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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, java.lang.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.
      EngineExecutionResults getExecutionResults()
      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 java.lang.Object

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

      • events

        private final java.util.List<Event> events
    • Constructor Detail

      • ExecutionRecorder

        public ExecutionRecorder()
    • Method Detail

      • 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,
                                     java.lang.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