@API(status=MAINTAINED,
since="1.7")
public class Execution
extends java.lang.Object
Execution encapsulates metadata for the execution of a single
TestDescriptor.| Modifier and Type | Field and Description |
|---|---|
private java.time.Duration |
duration |
private java.time.Instant |
endInstant |
private java.time.Instant |
startInstant |
private TerminationInfo |
terminationInfo |
private TestDescriptor |
testDescriptor |
| Modifier | Constructor and Description |
|---|---|
private |
Execution(TestDescriptor testDescriptor,
java.time.Instant startInstant,
java.time.Instant endInstant,
TerminationInfo terminationInfo) |
| Modifier and Type | Method and Description |
|---|---|
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. |
java.time.Duration |
getDuration()
Get the
Duration of this Execution. |
java.time.Instant |
getEndInstant()
Get the end
Instant of this Execution. |
java.time.Instant |
getStartInstant()
Get the start
Instant of this Execution. |
TerminationInfo |
getTerminationInfo()
Get the
TerminationInfo for this Execution. |
TestDescriptor |
getTestDescriptor()
Get the
TestDescriptor for this Execution. |
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. |
java.lang.String |
toString() |
private final TestDescriptor testDescriptor
private final java.time.Instant startInstant
private final java.time.Instant endInstant
private final java.time.Duration duration
private final TerminationInfo terminationInfo
private Execution(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, TerminationInfo terminationInfo)
public static Execution finished(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, TestExecutionResult executionResult)
Execution that finished with the
provided TestExecutionResult.testDescriptor - the TestDescriptor that finished;
never nullstartInstant - the Instant that the Execution started;
never nullendInstant - the Instant that the Execution completed;
never nullexecutionResult - the TestExecutionResult of the finished
TestDescriptor; never nullExecution instance; never nullpublic static Execution skipped(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, java.lang.String skipReason)
Execution that was skipped with the
provided skipReason.testDescriptor - the TestDescriptor that finished;
never nullstartInstant - the Instant that the Execution started;
never nullendInstant - the Instant that the Execution completed;
never nullskipReason - the reason the TestDescriptor was skipped;
may be nullExecution instance; never nullpublic TestDescriptor getTestDescriptor()
TestDescriptor for this Execution.TestDescriptor for this Executionpublic java.time.Instant getStartInstant()
Instant of this Execution.Instant of this Executionpublic java.time.Instant getEndInstant()
Instant of this Execution.Instant of this Executionpublic java.time.Duration getDuration()
Duration of this Execution.Duration of this Executionpublic TerminationInfo getTerminationInfo()
TerminationInfo for this Execution.TerminationInfo for this Executionpublic java.lang.String toString()
toString in class java.lang.Object