java.lang.Object
org.junit.platform.testkit.engine.Execution

@API(status=MAINTAINED, since="1.7") public class Execution extends Object
Execution encapsulates metadata for the execution of a single TestDescriptor.
Since:
1.4
  • Method Details

    • finished

      public static Execution finished(TestDescriptor testDescriptor, Instant startInstant, Instant endInstant, TestExecutionResult executionResult)
      Create a new instance of an Execution that finished with the provided TestExecutionResult.
      Parameters:
      testDescriptor - the TestDescriptor that finished; never null
      startInstant - the Instant that the Execution started; never null
      endInstant - the Instant that the Execution completed; never null
      executionResult - the TestExecutionResult of the finished TestDescriptor; never null
      Returns:
      the newly created Execution instance; never null
    • skipped

      public static Execution skipped(TestDescriptor testDescriptor, Instant startInstant, Instant endInstant, String skipReason)
      Create a new instance of an Execution that was skipped with the provided skipReason.
      Parameters:
      testDescriptor - the TestDescriptor that finished; never null
      startInstant - the Instant that the Execution started; never null
      endInstant - the Instant that the Execution completed; never null
      skipReason - the reason the TestDescriptor was skipped; may be null
      Returns:
      the newly created Execution instance; never null
    • getTestDescriptor

      public TestDescriptor getTestDescriptor()
      Get the TestDescriptor for this Execution.
      Returns:
      the TestDescriptor for this Execution
    • getStartInstant

      public Instant getStartInstant()
      Get the start Instant of this Execution.
      Returns:
      the start Instant of this Execution
    • getEndInstant

      public Instant getEndInstant()
      Get the end Instant of this Execution.
      Returns:
      the end Instant of this Execution
    • getDuration

      public Duration getDuration()
      Get the Duration of this Execution.
      Returns:
      the Duration of this Execution
    • getTerminationInfo

      public TerminationInfo getTerminationInfo()
      Get the TerminationInfo for this Execution.
      Returns:
      the TerminationInfo for this Execution
    • toString

      public String toString()
      Overrides:
      toString in class Object