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

public Class TerminationInfo

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

TerminationInfo is a union type that allows propagation of terminated container/test state, supporting either the reason if the container/test was skipped or the TestExecutionResult if the container/test was executed.
Since
1.4
See Also
Execution#getTerminationInfo()

Field Summary

Modifier and TypeField and Description
private final boolean
private final @Nullable String
private final @Nullable TestExecutionResult

Constructor Summary

AccessConstructor and Description
private
TerminationInfo(boolean skipped, @Nullable String skipReason, @Nullable TestExecutionResult testExecutionResult)

Method Summary

Modifier and TypeMethod and Description
public static TerminationInfo

Returns:

the created TerminationInfo; never null
executed
(TestExecutionResult
the result of the execution; never null
testExecutionResult
)

Create an executed TerminationInfo instance for the supplied TestExecutionResult.

public boolean

Returns:

true if this this TerminationInfo represents a completed execution
executed
()

Determine if this TerminationInfo represents a completed execution.

public TestExecutionResult

Returns:

the result of the completed execution
getExecutionResult
()

Get the TestExecutionResult for the completed execution.

public @Nullable String

Returns:

the reason the execution was skipped
getSkipReason
()

Get the reason the execution was skipped.

public boolean

Returns:

true if this this TerminationInfo does not represent a skipped execution
notSkipped
()

Determine if this TerminationInfo does not represent a skipped execution.

public static TerminationInfo

Returns:

the created TerminationInfo; never null
skipped
(@Nullable String
the reason the execution was skipped; may be null
reason
)

Create a skipped TerminationInfo instance for the supplied reason.

public boolean

Returns:

true if this this TerminationInfo represents a skipped execution
skipped
()

Determine if this TerminationInfo represents a skipped execution.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

skippedback to summary
private final boolean skipped
skipReasonback to summary
private final @Nullable String skipReason
testExecutionResultback to summary
private final @Nullable TestExecutionResult testExecutionResult

Constructor Detail

TerminationInfoback to summary
private TerminationInfo(boolean skipped, @Nullable String skipReason, @Nullable TestExecutionResult testExecutionResult)

Method Detail

executedback to summary
public static TerminationInfo executed(TestExecutionResult testExecutionResult)

Create an executed TerminationInfo instance for the supplied TestExecutionResult.

Parameters
testExecutionResult:TestExecutionResult

the result of the execution; never null

Returns:TerminationInfo

the created TerminationInfo; never null

See Also
skipped(String)
executedback to summary
public boolean executed()

Determine if this TerminationInfo represents a completed execution.

Returns:boolean

true if this this TerminationInfo represents a completed execution

getExecutionResultback to summary
public TestExecutionResult getExecutionResult() throws UnsupportedOperationException

Get the TestExecutionResult for the completed execution.

Returns:TestExecutionResult

the result of the completed execution

Exceptions
UnsupportedOperationException:
if this TerminationInfo does not represent a completed execution
getSkipReasonback to summary
public @Nullable String getSkipReason() throws UnsupportedOperationException

Get the reason the execution was skipped.

Returns:@Nullable String

the reason the execution was skipped

Exceptions
UnsupportedOperationException:
if this TerminationInfo does not represent a skipped execution
notSkippedback to summary
public boolean notSkipped()

Determine if this TerminationInfo does not represent a skipped execution.

Returns:boolean

true if this this TerminationInfo does not represent a skipped execution

skippedback to summary
public static TerminationInfo skipped(@Nullable String reason)

Create a skipped TerminationInfo instance for the supplied reason.

Parameters
reason:@Nullable String

the reason the execution was skipped; may be null

Returns:TerminationInfo

the created TerminationInfo; never null

See Also
executed(TestExecutionResult)
skippedback to summary
public boolean skipped()

Determine if this TerminationInfo represents a skipped execution.

Returns:boolean

true if this this TerminationInfo represents a skipped execution

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