Package org.apache.pulsar.tests
Class ThreadLeakDetectorListener
java.lang.Object
org.apache.pulsar.tests.ThreadLeakDetectorListener
- All Implemented Interfaces:
org.testng.IClassListener,org.testng.ITestListener,org.testng.ITestNGListener
Detects new threads that have been created during the test execution. This is useful to detect thread leaks.
Will create files to the configured directory if new threads are detected and THREAD_LEAK_DETECTOR_WAIT_MILLIS
is set to a positive value. A recommended value is 10000 for THREAD_LEAK_DETECTOR_WAIT_MILLIS. This will ensure
that any asynchronous operations should have completed before the detector determines that it has found a leak.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonBeforeClass(org.testng.ITestClass testClass) protected voidonBetweenTestClasses(Class<?> endedTestClass, Class<?> startedTestClass) Call back hook for adding logic when test execution moves from test class to another.voidonFinish(org.testng.ITestContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.IClassListener
onAfterClassMethods inherited from interface org.testng.ITestListener
onStart, onTestFailedButWithinSuccessPercentage, onTestFailedWithTimeout, onTestFailure, onTestSkipped, onTestStart, onTestSuccess
-
Constructor Details
-
ThreadLeakDetectorListener
public ThreadLeakDetectorListener()
-
-
Method Details
-
onBetweenTestClasses
Call back hook for adding logic when test execution moves from test class to another.- Parameters:
endedTestClass- the test class which has finished execution. null if the started test class is the firststartedTestClass- the test class which has started execution. null if the ended test class is the last
-
onBeforeClass
public void onBeforeClass(org.testng.ITestClass testClass) - Specified by:
onBeforeClassin interfaceorg.testng.IClassListener
-
onFinish
public void onFinish(org.testng.ITestContext context) - Specified by:
onFinishin interfaceorg.testng.ITestListener
-