Top Description Fields Constructors Methods
org.junit.platform.testkit.engine

public Class Execution

extends Object
Class Inheritance
Annotations
@API
status:MAINTAINED
since:1.7
Static Imports
org.apiguardian.api.API.Status.MAINTAINED

Execution encapsulates metadata for the execution of a single TestDescriptor.
Since
1.4

Field Summary

Modifier and TypeField and Description
private final Duration
private final Instant
private final Instant
private final TerminationInfo
private final TestDescriptor

Constructor Summary

AccessConstructor and Description
private
Execution(TestDescriptor testDescriptor, Instant startInstant, Instant endInstant, TerminationInfo terminationInfo)

Method Summary

Modifier and TypeMethod and Description
public static Execution

Returns:

the newly created Execution instance; never null
finished
(TestDescriptor
the TestDescriptor that finished; never null
testDescriptor
,
Instant
the Instant that the Execution started; never null
startInstant
,
Instant
the Instant that the Execution completed; never null
endInstant
,
TestExecutionResult
the TestExecutionResult of the finished TestDescriptor; never null
executionResult
)

Create a new instance of an Execution that finished with the provided TestExecutionResult.

public Duration

Returns:

the Duration of this Execution
getDuration
()

Get the Duration of this Execution.

public Instant

Returns:

the end Instant of this Execution
getEndInstant
()

Get the end Instant of this Execution.

public Instant

Returns:

the start Instant of this Execution
getStartInstant
()

Get the start Instant of this Execution.

public TerminationInfo

Returns:

the TerminationInfo for this Execution
getTerminationInfo
()

Get the TerminationInfo for this Execution.

public TestDescriptor

Returns:

the TestDescriptor for this Execution
getTestDescriptor
()

Get the TestDescriptor for this Execution.

public static Execution

Returns:

the newly created Execution instance; never null
skipped
(TestDescriptor
the TestDescriptor that finished; never null
testDescriptor
,
Instant
the Instant that the Execution started; never null
startInstant
,
Instant
the Instant that the Execution completed; never null
endInstant
,
String
the reason the TestDescriptor was skipped; may be null
skipReason
)

Create a new instance of an Execution that was skipped with the provided skipReason.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

durationback to summary
private final Duration duration
endInstantback to summary
private final Instant endInstant
startInstantback to summary
private final Instant startInstant
terminationInfoback to summary
private final TerminationInfo terminationInfo
testDescriptorback to summary
private final TestDescriptor testDescriptor

Constructor Detail

Executionback to summary
private Execution(TestDescriptor testDescriptor, Instant startInstant, Instant endInstant, TerminationInfo terminationInfo)

Method Detail

finishedback to summary
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:TestDescriptor

the TestDescriptor that finished; never null

startInstant:Instant

the Instant that the Execution started; never null

endInstant:Instant

the Instant that the Execution completed; never null

executionResult:TestExecutionResult

the TestExecutionResult of the finished TestDescriptor; never null

Returns:Execution

the newly created Execution instance; never null

getDurationback to summary
public Duration getDuration()

Get the Duration of this Execution.

Returns:Duration

the Duration of this Execution

getEndInstantback to summary
public Instant getEndInstant()

Get the end Instant of this Execution.

Returns:Instant

the end Instant of this Execution

getStartInstantback to summary
public Instant getStartInstant()

Get the start Instant of this Execution.

Returns:Instant

the start Instant of this Execution

getTerminationInfoback to summary
public TerminationInfo getTerminationInfo()

Get the TerminationInfo for this Execution.

Returns:TerminationInfo

the TerminationInfo for this Execution

getTestDescriptorback to summary
public TestDescriptor getTestDescriptor()

Get the TestDescriptor for this Execution.

Returns:TestDescriptor

the TestDescriptor for this Execution

skippedback to summary
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:TestDescriptor

the TestDescriptor that finished; never null

startInstant:Instant

the Instant that the Execution started; never null

endInstant:Instant

the Instant that the Execution completed; never null

skipReason:String

the reason the TestDescriptor was skipped; may be null

Returns:Execution

the newly created Execution instance; never null

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override