Class TerminationInfo
java.lang.Object
org.junit.platform.testkit.engine.TerminationInfo
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:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexecuted()Determine if thisTerminationInforepresents a completed execution.static TerminationInfoexecuted(TestExecutionResult testExecutionResult) Create an executedTerminationInfoinstance for the suppliedTestExecutionResult.Get theTestExecutionResultfor the completed execution.@Nullable StringGet the reason the execution was skipped.booleanDetermine if thisTerminationInfodoes not represent a skipped execution.booleanskipped()Determine if thisTerminationInforepresents a skipped execution.static TerminationInfoCreate a skippedTerminationInfoinstance for the supplied reason.toString()
-
Method Details
-
skipped
Create a skippedTerminationInfoinstance for the supplied reason.- Parameters:
reason- the reason the execution was skipped; may benull- Returns:
- the created
TerminationInfo; nevernull - See Also:
-
executed
Create an executedTerminationInfoinstance for the suppliedTestExecutionResult.- Parameters:
testExecutionResult- the result of the execution; nevernull- Returns:
- the created
TerminationInfo; nevernull - See Also:
-
skipped
public boolean skipped()Determine if thisTerminationInforepresents a skipped execution.- Returns:
trueif this thisTerminationInforepresents a skipped execution
-
notSkipped
public boolean notSkipped()Determine if thisTerminationInfodoes not represent a skipped execution.- Returns:
trueif this thisTerminationInfodoes not represent a skipped execution
-
executed
public boolean executed()Determine if thisTerminationInforepresents a completed execution.- Returns:
trueif this thisTerminationInforepresents a completed execution
-
getSkipReason
Get the reason the execution was skipped.- Returns:
- the reason the execution was skipped
- Throws:
UnsupportedOperationException- if thisTerminationInfodoes not represent a skipped execution
-
getExecutionResult
Get theTestExecutionResultfor the completed execution.- Returns:
- the result of the completed execution
- Throws:
UnsupportedOperationException- if thisTerminationInfodoes not represent a completed execution
-
toString
-