Class SingleTestExecutor
- java.lang.Object
-
- org.junit.platform.engine.support.hierarchical.SingleTestExecutor
-
@API(status=MAINTAINED, since="1.0") public class SingleTestExecutor extends Object
SingleTestExecutor
encapsulates the execution of a single test wrapped in anSingleTestExecutor.Executable
.- Since:
- 1.0
- See Also:
executeSafely(Executable)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SingleTestExecutor.Executable
Functional interface for a single test to be executed bySingleTestExecutor
.
-
Constructor Summary
Constructors Constructor Description SingleTestExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TestExecutionResult
executeSafely(SingleTestExecutor.Executable executable)
Execute the suppliedSingleTestExecutor.Executable
and return aTestExecutionResult
based on the outcome.
-
-
-
Method Detail
-
executeSafely
public TestExecutionResult executeSafely(SingleTestExecutor.Executable executable)
Execute the suppliedSingleTestExecutor.Executable
and return aTestExecutionResult
based on the outcome.If the
Executable
throws a blacklisted exception — for example, anOutOfMemoryError
— this method will rethrow it.- Parameters:
executable
- the test to be executed- Returns:
- aborted if the
Executable
throws aTestAbortedException
; failed if any otherThrowable
is thrown; and successful otherwise
-
-