You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/cosmos/azure-cosmos-encryption/src/test/java/com/azure/cosmos/encryption/CosmosNettyLeakDetectorFactory.java
+23-4Lines changed: 23 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
importorg.testng.IInvokedMethod;
17
17
importorg.testng.IInvokedMethodListener;
18
18
importorg.testng.ITestClass;
19
+
importorg.testng.ITestNGMethod;
19
20
importorg.testng.ITestResult;
20
21
21
22
importjava.lang.management.BufferPoolMXBean;
@@ -70,7 +71,7 @@ public void onBeforeClass(ITestClass testClass) {
70
71
71
72
@Override
72
73
publicvoidonAfterClass(ITestClasstestClass) {
73
-
// Unfortunately can't use this in TestNG 7.51 because execution is not symmetric
74
+
// Unfortunately can't use this consistently in TestNG 7.51 because execution is not symmetric
74
75
// IClassListener.onBeforeClass
75
76
// TestClassBase.@BeforeClass
76
77
// TestClass.@BeforeClass
@@ -81,14 +82,32 @@ public void onAfterClass(ITestClass testClass) {
81
82
// -Dtestng.listener.execution.symmetric=true allows, but this is only available
82
83
// in TestNG 7.7.1 - which requires Java11
83
84
// So, this class simulates this behavior by hooking into IInvokedMethodListener
85
+
// If the test class itself does not have @afterClass we execute the logic here
0 commit comments