Package org.junit.platform.engine
Class TestExecutionResult
java.lang.Object
org.junit.platform.engine.TestExecutionResult
TestExecutionResult
encapsulates the result of executing a single test
or container.
A TestExecutionResult
consists of a mandatory
Status
and an optional Throwable
.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Status of executing a single test or container. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TestExecutionResult.Status
private static final TestExecutionResult
private final Throwable
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TestExecutionResult
(TestExecutionResult.Status status, Throwable throwable) -
Method Summary
Modifier and TypeMethodDescriptionstatic TestExecutionResult
Create aTestExecutionResult
for an aborted execution of a test or container with the suppliedthrowable
.static TestExecutionResult
Create aTestExecutionResult
for a failed execution of a test or container with the suppliedthrowable
.Get the status of this result.Get the throwable that caused this result, if available.static TestExecutionResult
Create aTestExecutionResult
for a successful execution of a test or container.toString()
-
Field Details
-
SUCCESSFUL_RESULT
-
status
-
throwable
-
-
Constructor Details
-
TestExecutionResult
-
-
Method Details
-
successful
Create aTestExecutionResult
for a successful execution of a test or container.- Returns:
- the
TestExecutionResult
; nevernull
-
aborted
Create aTestExecutionResult
for an aborted execution of a test or container with the suppliedthrowable
.- Parameters:
throwable
- the throwable that caused the aborted execution; may benull
- Returns:
- the
TestExecutionResult
; nevernull
-
failed
Create aTestExecutionResult
for a failed execution of a test or container with the suppliedthrowable
.- Parameters:
throwable
- the throwable that caused the failed execution; may benull
- Returns:
- the
TestExecutionResult
; nevernull
-
getStatus
Get the status of this result.- Returns:
- the status; never
null
-
getThrowable
Get the throwable that caused this result, if available.- Returns:
- an
Optional
containing the throwable; nevernull
but potentially empty
-
toString
-