Package org.junit.jupiter.api.extension
Interface PreInterruptCallback
-
- All Superinterfaces:
Extension
@API(status=MAINTAINED, since="5.13.3") public interface PreInterruptCallback extends ExtensionPreInterruptCallbackdefines the API forExtensionsthat wish to be called prior to invocations ofThread.interrupt()by theTimeoutextension.JUnit registers a default implementation that dumps the stacks of all threads to
System.outif the "junit.jupiter.execution.timeout.threaddump.enabled" configuration parameter is set totrue.- Since:
- 5.12
- See Also:
Timeout
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTHREAD_DUMP_ENABLED_PROPERTY_NAMEProperty name used to enable dumping the stack of all threads toSystem.outwhen a timeout has occurred.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeforeThreadInterrupt(PreInterruptContext preInterruptContext, ExtensionContext extensionContext)Callback that is invoked before aThreadis interrupted withThread.interrupt().
-
-
-
Field Detail
-
THREAD_DUMP_ENABLED_PROPERTY_NAME
@API(status=MAINTAINED, since="5.13.3") static final java.lang.String THREAD_DUMP_ENABLED_PROPERTY_NAMEProperty name used to enable dumping the stack of all threads toSystem.outwhen a timeout has occurred.This behavior is disabled by default.
- Since:
- 5.12
- See Also:
- Constant Field Values
-
-
Method Detail
-
beforeThreadInterrupt
@API(status=MAINTAINED, since="5.13.3") void beforeThreadInterrupt(PreInterruptContext preInterruptContext, ExtensionContext extensionContext) throws java.lang.ExceptionCallback that is invoked before aThreadis interrupted withThread.interrupt().Note: There is no guarantee on which
Threadthis callback will be executed.- Parameters:
preInterruptContext- the context with the targetThread, which will get interrupted.extensionContext- the extension context for the callback; nevernull- Throws:
java.lang.Exception- Since:
- 5.12
- See Also:
PreInterruptContext
-
-