- All Superinterfaces:
Extension
PreInterruptCallback
defines the API for Extensions
that wish to be called prior to invocations of
Thread.interrupt()
by the Timeout
extension.
JUnit registers a default implementation that dumps the stacks of all
threads to System.out
if the
"junit.jupiter.execution.timeout.threaddump.enabled" configuration parameter is set to
true
.
- Since:
- 5.12
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeThreadInterrupt
(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) Callback that is invoked before aThread
is interrupted withThread.interrupt()
.
-
Field Details
-
THREAD_DUMP_ENABLED_PROPERTY_NAME
Property name used to enable dumping the stack of all threads toSystem.out
when a timeout has occurred.This behavior is disabled by default.
- Since:
- 5.12
- See Also:
-
-
Method Details
-
beforeThreadInterrupt
@API(status=EXPERIMENTAL, since="5.12") void beforeThreadInterrupt(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) throws Exception Callback that is invoked before aThread
is interrupted withThread.interrupt()
.Note: There is no guarantee on which
Thread
this callback will be executed.
-