Class Execution
- java.lang.Object
-
- org.junit.platform.testkit.engine.Execution
-
@API(status=EXPERIMENTAL, since="1.4") public class Execution extends java.lang.Object
Execution
encapsulates metadata for the execution of a singleTestDescriptor
.- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.time.Duration
duration
private java.time.Instant
endInstant
private java.time.Instant
startInstant
private TerminationInfo
terminationInfo
private TestDescriptor
testDescriptor
-
Constructor Summary
Constructors Modifier Constructor Description private
Execution(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, TerminationInfo terminationInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Execution
finished(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, TestExecutionResult executionResult)
Create a new instance of anExecution
that finished with the providedTestExecutionResult
.java.time.Duration
getDuration()
Get theDuration
of thisExecution
.java.time.Instant
getEndInstant()
Get the endInstant
of thisExecution
.java.time.Instant
getStartInstant()
Get the startInstant
of thisExecution
.TerminationInfo
getTerminationInfo()
Get theTerminationInfo
for thisExecution
.TestDescriptor
getTestDescriptor()
Get theTestDescriptor
for thisExecution
.static Execution
skipped(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, java.lang.String skipReason)
Create a new instance of anExecution
that was skipped with the providedskipReason
.java.lang.String
toString()
-
-
-
Field Detail
-
testDescriptor
private final TestDescriptor testDescriptor
-
startInstant
private final java.time.Instant startInstant
-
endInstant
private final java.time.Instant endInstant
-
duration
private final java.time.Duration duration
-
terminationInfo
private final TerminationInfo terminationInfo
-
-
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 anExecution
that finished with the providedTestExecutionResult
.- Parameters:
testDescriptor
- theTestDescriptor
that finished; nevernull
startInstant
- theInstant
that theExecution
started; nevernull
endInstant
- theInstant
that theExecution
completed; nevernull
executionResult
- theTestExecutionResult
of the finishedTestDescriptor
; nevernull
- Returns:
- the newly created
Execution
instance; nevernull
-
skipped
public static Execution skipped(TestDescriptor testDescriptor, java.time.Instant startInstant, java.time.Instant endInstant, java.lang.String skipReason)
Create a new instance of anExecution
that was skipped with the providedskipReason
.- Parameters:
testDescriptor
- theTestDescriptor
that finished; nevernull
startInstant
- theInstant
that theExecution
started; nevernull
endInstant
- theInstant
that theExecution
completed; nevernull
skipReason
- the reason theTestDescriptor
was skipped; may benull
- Returns:
- the newly created
Execution
instance; nevernull
-
getTestDescriptor
public TestDescriptor getTestDescriptor()
Get theTestDescriptor
for thisExecution
.- Returns:
- the
TestDescriptor
for thisExecution
-
getStartInstant
public java.time.Instant getStartInstant()
Get the startInstant
of thisExecution
.- Returns:
- the start
Instant
of thisExecution
-
getEndInstant
public java.time.Instant getEndInstant()
Get the endInstant
of thisExecution
.- Returns:
- the end
Instant
of thisExecution
-
getDuration
public java.time.Duration getDuration()
Get theDuration
of thisExecution
.- Returns:
- the
Duration
of thisExecution
-
getTerminationInfo
public TerminationInfo getTerminationInfo()
Get theTerminationInfo
for thisExecution
.- Returns:
- the
TerminationInfo
for thisExecution
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-