Class DeadlockDetectionExtension

java.lang.Object
gov.nist.secauto.metaschema.model.testing.DeadlockDetectionExtension
All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestWatcher

public class DeadlockDetectionExtension extends Object implements org.junit.jupiter.api.extension.TestWatcher
A JUnit 5 extension that detects deadlocks and dumps thread information when tests fail or are aborted (e.g., due to timeout).

To use this extension, annotate your test class with:

 @ExtendWith(DeadlockDetectionExtension.class)
 

Or register it globally via META-INF/services/org.junit.jupiter.api.extension.Extension.

  • Constructor Details

  • Method Details

    • testAborted

      public void testAborted(org.junit.jupiter.api.extension.ExtensionContext context, Throwable cause)
      Specified by:
      testAborted in interface org.junit.jupiter.api.extension.TestWatcher
    • testFailed

      public void testFailed(org.junit.jupiter.api.extension.ExtensionContext context, Throwable cause)
      Specified by:
      testFailed in interface org.junit.jupiter.api.extension.TestWatcher
    • testDisabled

      public void testDisabled(org.junit.jupiter.api.extension.ExtensionContext context, Optional<String> reason)
      Specified by:
      testDisabled in interface org.junit.jupiter.api.extension.TestWatcher
    • testSuccessful

      public void testSuccessful(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      testSuccessful in interface org.junit.jupiter.api.extension.TestWatcher