Class PreInterruptThreadDumpPrinter

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.PreInterruptCallback

    final class PreInterruptThreadDumpPrinter
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String NL  
      • Fields inherited from interface org.junit.jupiter.api.extension.PreInterruptCallback

        THREAD_DUMP_ENABLED_PROPERTY_NAME
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void appendThreadName​(java.lang.StringBuilder sb, java.lang.Thread th)
      Appends the Thread name and ID in a similar fashion as jstack.
      void beforeThreadInterrupt​(org.junit.jupiter.api.extension.PreInterruptContext preInterruptContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PreInterruptThreadDumpPrinter

        PreInterruptThreadDumpPrinter()
    • Method Detail

      • 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​(java.lang.StringBuilder sb,
                                      java.lang.Thread th)
        Appends the Thread name and ID in a similar fashion as jstack.
        Parameters:
        sb - the buffer
        th - the thread to append