Package com.azure.core.test
Class ThreadDumper
java.lang.Object
com.azure.core.test.ThreadDumper
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension
public class ThreadDumper
extends Object
implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
A utility and extension to dump threads after 30 minutes from starting tests. It can be used as standalone utility
via
initialize() as well as hooked up with JUnit by implementing
BeforeAllCallback.beforeAll(ExtensionContext).
ThreadDumper also tracks which tests are running and when they began running. These tests and how long they've been running will be included in the thread dumps if they've been running longer than 5 minutes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEach(org.junit.jupiter.api.extension.ExtensionContext context) voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext context) voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) static voidInitializes the singleton dumper.
-
Constructor Details
-
ThreadDumper
public ThreadDumper()Creates a new instance ofThreadDumper.
-
-
Method Details
-
initialize
public static void initialize()Initializes the singleton dumper. Can be called multiple times safely. -
beforeAll
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeAllin interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback
-