Class TimeoutInvocation<T>
- java.lang.Object
-
- org.junit.jupiter.engine.extension.TimeoutInvocation<T>
-
- All Implemented Interfaces:
InvocationInterceptor.Invocation<T>
class TimeoutInvocation<T> extends java.lang.Object implements InvocationInterceptor.Invocation<T>
- Since:
- 5.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TimeoutInvocation.InterruptTask
-
Field Summary
Fields Modifier and Type Field Description private InvocationInterceptor.Invocation<T>
delegate
private java.util.function.Supplier<java.lang.String>
descriptionSupplier
private java.util.concurrent.ScheduledExecutorService
executor
private TimeoutDuration
timeout
-
Constructor Summary
Constructors Constructor Description TimeoutInvocation(InvocationInterceptor.Invocation<T> delegate, TimeoutDuration timeout, java.util.concurrent.ScheduledExecutorService executor, java.util.function.Supplier<java.lang.String> descriptionSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.concurrent.TimeoutException
createTimeoutException(java.lang.Throwable failure)
T
proceed()
Proceed with this invocation.
-
-
-
Field Detail
-
delegate
private final InvocationInterceptor.Invocation<T> delegate
-
timeout
private final TimeoutDuration timeout
-
executor
private final java.util.concurrent.ScheduledExecutorService executor
-
descriptionSupplier
private final java.util.function.Supplier<java.lang.String> descriptionSupplier
-
-
Constructor Detail
-
TimeoutInvocation
TimeoutInvocation(InvocationInterceptor.Invocation<T> delegate, TimeoutDuration timeout, java.util.concurrent.ScheduledExecutorService executor, java.util.function.Supplier<java.lang.String> descriptionSupplier)
-
-
Method Detail
-
proceed
public T proceed() throws java.lang.Throwable
Description copied from interface:InvocationInterceptor.Invocation
Proceed with this invocation.- Specified by:
proceed
in interfaceInvocationInterceptor.Invocation<T>
- Returns:
- the result of this invocation; potentially
null
. - Throws:
java.lang.Throwable
- in case the invocation failed
-
createTimeoutException
private java.util.concurrent.TimeoutException createTimeoutException(java.lang.Throwable failure)
-
-