共用方式為


ThreadDumper Class

  • java.lang.Object
    • com.azure.core.test.ThreadDumper

Implements

org.junit.jupiter.api.extension.AfterEachCallback org.junit.jupiter.api.extension.BeforeAllCallback org.junit.jupiter.api.extension.BeforeEachCallback

public class ThreadDumper
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

Constructor Description
ThreadDumper()

Creates a new instance of ThreadDumper.

Method Summary

Modifier and Type Method and Description
void afterEach(ExtensionContext context)
void beforeAll(ExtensionContext context)
void beforeEach(ExtensionContext context)
static void initialize()

Initializes the singleton dumper.

Methods inherited from java.lang.Object

Constructor Details

ThreadDumper

public ThreadDumper()

Creates a new instance of ThreadDumper.

Method Details

afterEach

public void afterEach(ExtensionContext context)

Parameters:

context

beforeAll

public void beforeAll(ExtensionContext context)

Parameters:

context

beforeEach

public void beforeEach(ExtensionContext context)

Parameters:

context

initialize

public static void initialize()

Initializes the singleton dumper. Can be called multiple times safely.

Applies to