Class Execution


  • @API(status=EXPERIMENTAL,
         since="1.4")
    public class Execution
    extends java.lang.Object
    Execution encapsulates metadata for the execution of a single TestDescriptor.
    Since:
    1.4
    • Field Detail

      • startInstant

        private final java.time.Instant startInstant
      • endInstant

        private final java.time.Instant endInstant
      • duration

        private final java.time.Duration duration
    • Constructor Detail

      • Execution

        private Execution​(TestDescriptor testDescriptor,
                          java.time.Instant startInstant,
                          java.time.Instant endInstant,
                          TerminationInfo terminationInfo)
    • Method Detail

      • finished

        public static Execution finished​(TestDescriptor testDescriptor,
                                         java.time.Instant startInstant,
                                         java.time.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,
                                        java.time.Instant startInstant,
                                        java.time.Instant endInstant,
                                        java.lang.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 java.time.Instant getStartInstant()
        Get the start Instant of this Execution.
        Returns:
        the start Instant of this Execution
      • getEndInstant

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

        public java.time.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object