@API(status=MAINTAINED,
since="1.7")
public class TerminationInfo
extends java.lang.Object
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.Execution.getTerminationInfo()| Modifier and Type | Field and Description |
|---|---|
private boolean |
skipped |
private java.lang.String |
skipReason |
private TestExecutionResult |
testExecutionResult |
| Modifier | Constructor and Description |
|---|---|
private |
TerminationInfo(boolean skipped,
java.lang.String skipReason,
TestExecutionResult testExecutionResult) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
executed()
Determine if this
TerminationInfo represents a completed execution. |
static TerminationInfo |
executed(TestExecutionResult testExecutionResult)
Create an executed
TerminationInfo instance for the
supplied TestExecutionResult. |
TestExecutionResult |
getExecutionResult()
Get the
TestExecutionResult for the completed execution. |
java.lang.String |
getSkipReason()
Get the reason the execution was skipped.
|
boolean |
notSkipped()
Determine if this
TerminationInfo does not represent a skipped
execution. |
boolean |
skipped()
Determine if this
TerminationInfo represents a skipped execution. |
static TerminationInfo |
skipped(java.lang.String reason)
Create a skipped
TerminationInfo instance for the
supplied reason. |
java.lang.String |
toString() |
private final boolean skipped
private final java.lang.String skipReason
private final TestExecutionResult testExecutionResult
private TerminationInfo(boolean skipped,
java.lang.String skipReason,
TestExecutionResult testExecutionResult)
public static TerminationInfo skipped(java.lang.String reason)
TerminationInfo instance for the
supplied reason.reason - the reason the execution was skipped; may be nullTerminationInfo; never nullexecuted(TestExecutionResult)public static TerminationInfo executed(TestExecutionResult testExecutionResult)
TerminationInfo instance for the
supplied TestExecutionResult.testExecutionResult - the result of the execution; never nullTerminationInfo; never nullskipped(String)public boolean skipped()
TerminationInfo represents a skipped execution.true if this this TerminationInfo represents a
skipped executionpublic boolean notSkipped()
TerminationInfo does not represent a skipped
execution.true if this this TerminationInfo does not
represent a skipped executionpublic boolean executed()
TerminationInfo represents a completed execution.true if this this TerminationInfo represents a
completed executionpublic java.lang.String getSkipReason()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException - if this TerminationInfo
does not represent a skipped executionpublic TestExecutionResult getExecutionResult() throws java.lang.UnsupportedOperationException
TestExecutionResult for the completed execution.java.lang.UnsupportedOperationException - if this TerminationInfo
does not represent a completed executionpublic java.lang.String toString()
toString in class java.lang.Object