Package testUtils
Class TestResultLoggerListener
java.lang.Object
testUtils.TestResultLoggerListener
- All Implemented Interfaces:
org.testng.ITestListener
,org.testng.ITestNGListener
TestNG listener that logs test execution events using Log4j2.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onTestFailure
(org.testng.ITestResult result) Called when a test method fails.void
onTestSkipped
(org.testng.ITestResult result) Called when a test method is skipped.void
onTestStart
(org.testng.ITestResult result) Called when a test method starts.void
onTestSuccess
(org.testng.ITestResult result) Called when a test method passes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.testng.ITestListener
onFinish, onStart, onTestFailedButWithinSuccessPercentage, onTestFailedWithTimeout
Methods inherited from interface org.testng.ITestNGListener
isEnabled
-
Constructor Details
-
TestResultLoggerListener
public TestResultLoggerListener()
-
-
Method Details
-
onTestStart
public void onTestStart(org.testng.ITestResult result) Called when a test method starts. Logs the method name and parameters.- Specified by:
onTestStart
in interfaceorg.testng.ITestListener
- Parameters:
result
- the test result
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult result) Called when a test method passes. Logs the method name.- Specified by:
onTestSuccess
in interfaceorg.testng.ITestListener
- Parameters:
result
- the test result
-
onTestFailure
public void onTestFailure(org.testng.ITestResult result) Called when a test method fails. Logs the method name and throwable.- Specified by:
onTestFailure
in interfaceorg.testng.ITestListener
- Parameters:
result
- the test result
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult result) Called when a test method is skipped. Logs the method name.- Specified by:
onTestSkipped
in interfaceorg.testng.ITestListener
- Parameters:
result
- the test result
-