Interface PreInterruptCallback
- 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
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault value for "junit.jupiter.execution.timeout.threaddump.enabled" is false.static final StringProperty name used to enable dumping the stack of all threads toSystem.outwhen a timeout has occurred. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeThreadInterrupt(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) Callback that is invoked before aThreadis interrupted withThread.interrupt().
-
Field Details
-
THREAD_DUMP_ENABLED_DEFAULT
@API(status=MAINTAINED, since="6.2") static final boolean THREAD_DUMP_ENABLED_DEFAULTDefault value for "junit.jupiter.execution.timeout.threaddump.enabled" is false.- Since:
- 6.2
- See Also:
-
THREAD_DUMP_ENABLED_PROPERTY_NAME
-
-
Method Details
-
beforeThreadInterrupt
@API(status=MAINTAINED, since="5.13.3") void beforeThreadInterrupt(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) throws Exception Callback that is invoked before aThreadis interrupted withThread.interrupt().Note: There is no guarantee on which
Threadthis callback will be executed.
-