java.lang.Object
org.junit.jupiter.api.AssertTimeout
AssertTimeout
is a collection of utility methods that support asserting
the execution of the code under test did not take longer than the timeout duration.- Since:
- 5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
The thread factory used for preemptive timeout. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
assertTimeout
(Duration timeout, Executable executable) (package private) static void
assertTimeout
(Duration timeout, Executable executable, String message) (package private) static void
assertTimeout
(Duration timeout, Executable executable, Supplier<String> messageSupplier) (package private) static <T> T
assertTimeout
(Duration timeout, ThrowingSupplier<T> supplier) private static <T> T
assertTimeout
(Duration timeout, ThrowingSupplier<T> supplier, Object messageOrSupplier) (package private) static <T> T
assertTimeout
(Duration timeout, ThrowingSupplier<T> supplier, String message) (package private) static <T> T
assertTimeout
(Duration timeout, ThrowingSupplier<T> supplier, Supplier<String> messageSupplier) (package private) static void
assertTimeoutPreemptively
(Duration timeout, Executable executable) (package private) static void
assertTimeoutPreemptively
(Duration timeout, Executable executable, String message) (package private) static void
assertTimeoutPreemptively
(Duration timeout, Executable executable, Supplier<String> messageSupplier) (package private) static <T> T
assertTimeoutPreemptively
(Duration timeout, ThrowingSupplier<T> supplier) private static <T> T
assertTimeoutPreemptively
(Duration timeout, ThrowingSupplier<T> supplier, Object messageOrSupplier) (package private) static <T> T
assertTimeoutPreemptively
(Duration timeout, ThrowingSupplier<T> supplier, String message) (package private) static <T> T
assertTimeoutPreemptively
(Duration timeout, ThrowingSupplier<T> supplier, Supplier<String> messageSupplier)
-
Constructor Details
-
AssertTimeout
private AssertTimeout()
-
-
Method Details
-
assertTimeout
-
assertTimeout
-
assertTimeout
static void assertTimeout(Duration timeout, Executable executable, Supplier<String> messageSupplier) -
assertTimeout
-
assertTimeout
-
assertTimeout
static <T> T assertTimeout(Duration timeout, ThrowingSupplier<T> supplier, Supplier<String> messageSupplier) -
assertTimeout
private static <T> T assertTimeout(Duration timeout, ThrowingSupplier<T> supplier, Object messageOrSupplier) -
assertTimeoutPreemptively
-
assertTimeoutPreemptively
-
assertTimeoutPreemptively
static void assertTimeoutPreemptively(Duration timeout, Executable executable, Supplier<String> messageSupplier) -
assertTimeoutPreemptively
-
assertTimeoutPreemptively
static <T> T assertTimeoutPreemptively(Duration timeout, ThrowingSupplier<T> supplier, String message) -
assertTimeoutPreemptively
static <T> T assertTimeoutPreemptively(Duration timeout, ThrowingSupplier<T> supplier, Supplier<String> messageSupplier) -
assertTimeoutPreemptively
private static <T> T assertTimeoutPreemptively(Duration timeout, ThrowingSupplier<T> supplier, Object messageOrSupplier)
-