Package org.junit.jupiter.api
Class AssertTimeout
- java.lang.Object
-
- org.junit.jupiter.api.AssertTimeout
-
class AssertTimeout extends java.lang.ObjectAssertTimeoutis 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 Classes Modifier and Type Class Description private static classAssertTimeout.ExecutionTimeoutExceptionprivate static classAssertTimeout.TimeoutThreadFactoryThe thread factory used for preemptive timeout.
-
Constructor Summary
Constructors Modifier Constructor Description privateAssertTimeout()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidassertTimeout(java.time.Duration timeout, Executable executable)(package private) static voidassertTimeout(java.time.Duration timeout, Executable executable, java.lang.String message)(package private) static voidassertTimeout(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)(package private) static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier)private static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.Object messageOrSupplier)(package private) static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)(package private) static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)(package private) static voidassertTimeoutPreemptively(java.time.Duration timeout, Executable executable)(package private) static voidassertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.lang.String message)(package private) static voidassertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)(package private) static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier)private static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.Object messageOrSupplier)(package private) static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)(package private) static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)
-
-
-
Method Detail
-
assertTimeout
static void assertTimeout(java.time.Duration timeout, Executable executable)
-
assertTimeout
static void assertTimeout(java.time.Duration timeout, Executable executable, java.lang.String message)
-
assertTimeout
static void assertTimeout(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)
-
assertTimeout
static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier)
-
assertTimeout
static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)
-
assertTimeout
static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)
-
assertTimeout
private static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.Object messageOrSupplier)
-
assertTimeoutPreemptively
static void assertTimeoutPreemptively(java.time.Duration timeout, Executable executable)
-
assertTimeoutPreemptively
static void assertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.lang.String message)
-
assertTimeoutPreemptively
static void assertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)
-
assertTimeoutPreemptively
static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier)
-
assertTimeoutPreemptively
static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)
-
assertTimeoutPreemptively
static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)
-
assertTimeoutPreemptively
private static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.Object messageOrSupplier)
-
-