Class PreInterruptThreadDumpPrinter

java.lang.Object
org.junit.jupiter.engine.extension.PreInterruptThreadDumpPrinter
All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.PreInterruptCallback

final class PreInterruptThreadDumpPrinter extends Object implements org.junit.jupiter.api.extension.PreInterruptCallback
The default implementation for PreInterruptCallback, which will print the stacks of all Threads to System.out.

Note: This is disabled by default, and must be enabled with Constants.EXTENSIONS_TIMEOUT_THREAD_DUMP_ENABLED_PROPERTY_NAME

Since:
5.12
  • Field Details

  • Constructor Details

    • PreInterruptThreadDumpPrinter

      PreInterruptThreadDumpPrinter()
  • Method Details

    • beforeThreadInterrupt

      public void beforeThreadInterrupt(org.junit.jupiter.api.extension.PreInterruptContext preInterruptContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
      Specified by:
      beforeThreadInterrupt in interface org.junit.jupiter.api.extension.PreInterruptCallback
    • appendThreadName

      private void appendThreadName(StringBuilder sb, Thread th)
      Appends the Thread name and ID in a similar fashion as jstack.
      Parameters:
      sb - the buffer
      th - the thread to append