Package org.testng.reporters
Class ExitCodeListener
- java.lang.Object
-
- org.testng.reporters.ExitCodeListener
-
- All Implemented Interfaces:
IConfigurationListener,IResultListener,IResultListener2,ITestListener,ITestNGListener
public class ExitCodeListener extends java.lang.Object implements IResultListener2
A very simpleITestListenerused by the TestNG runner to find out the exit code.
-
-
Field Summary
Fields Modifier and Type Field Description private TestNGm_mainRunner
-
Constructor Summary
Constructors Constructor Description ExitCodeListener()ExitCodeListener(TestNG runner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeConfiguration(ITestResult tr)Invoked before a configuration method is invoked.voidonConfigurationFailure(ITestResult itr)Invoked whenever a configuration method failed.voidonConfigurationSkip(ITestResult itr)Invoked whenever a configuration method was skipped.voidonConfigurationSuccess(ITestResult itr)Invoked whenever a configuration method succeeded.voidonFinish(ITestContext context)Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.voidonStart(ITestContext context)Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.voidonTestFailedButWithinSuccessPercentage(ITestResult result)Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.voidonTestFailure(ITestResult result)Invoked each time a test fails.voidonTestSkipped(ITestResult result)Invoked each time a test is skipped.voidonTestStart(ITestResult result)Invoked each time before a test will be invoked.voidonTestSuccess(ITestResult result)Invoked each time a test succeeds.private voidsetHasRunTests()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.testng.IConfigurationListener
beforeConfiguration, onConfigurationFailure, onConfigurationSkip, onConfigurationSuccess
-
Methods inherited from interface org.testng.ITestListener
onTestFailedWithTimeout
-
-
-
-
Field Detail
-
m_mainRunner
private TestNG m_mainRunner
-
-
Constructor Detail
-
ExitCodeListener
public ExitCodeListener()
-
ExitCodeListener
public ExitCodeListener(TestNG runner)
-
-
Method Detail
-
beforeConfiguration
public void beforeConfiguration(ITestResult tr)
Description copied from interface:IConfigurationListenerInvoked before a configuration method is invoked.- Specified by:
beforeConfigurationin interfaceIConfigurationListener- Parameters:
tr- The test result
-
onTestFailure
public void onTestFailure(ITestResult result)
Description copied from interface:ITestListenerInvoked each time a test fails.- Specified by:
onTestFailurein interfaceITestListener- Parameters:
result-ITestResultcontaining information about the run test- See Also:
ITestResult.FAILURE
-
onTestSkipped
public void onTestSkipped(ITestResult result)
Description copied from interface:ITestListenerInvoked each time a test is skipped.- Specified by:
onTestSkippedin interfaceITestListener- Parameters:
result-ITestResultcontaining information about the run test- See Also:
ITestResult.SKIP
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(ITestResult result)
Description copied from interface:ITestListenerInvoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.- Specified by:
onTestFailedButWithinSuccessPercentagein interfaceITestListener- Parameters:
result-ITestResultcontaining information about the run test- See Also:
ITestResult.SUCCESS_PERCENTAGE_FAILURE
-
onTestSuccess
public void onTestSuccess(ITestResult result)
Description copied from interface:ITestListenerInvoked each time a test succeeds.- Specified by:
onTestSuccessin interfaceITestListener- Parameters:
result-ITestResultcontaining information about the run test- See Also:
ITestResult.SUCCESS
-
onStart
public void onStart(ITestContext context)
Description copied from interface:ITestListenerInvoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.- Specified by:
onStartin interfaceITestListener- Parameters:
context- The test context
-
onFinish
public void onFinish(ITestContext context)
Description copied from interface:ITestListenerInvoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.- Specified by:
onFinishin interfaceITestListener- Parameters:
context- The test context
-
onTestStart
public void onTestStart(ITestResult result)
Description copied from interface:ITestListenerInvoked each time before a test will be invoked. TheITestResultis only partially filled with the references to class, method, start millis and status.- Specified by:
onTestStartin interfaceITestListener- Parameters:
result- the partially filledITestResult- See Also:
ITestResult.STARTED
-
setHasRunTests
private void setHasRunTests()
-
onConfigurationFailure
public void onConfigurationFailure(ITestResult itr)
Description copied from interface:IConfigurationListenerInvoked whenever a configuration method failed.- Specified by:
onConfigurationFailurein interfaceIConfigurationListener- Parameters:
itr- The test result- See Also:
IConfigurationListener.onConfigurationFailure(org.testng.ITestResult)
-
onConfigurationSkip
public void onConfigurationSkip(ITestResult itr)
Description copied from interface:IConfigurationListenerInvoked whenever a configuration method was skipped.- Specified by:
onConfigurationSkipin interfaceIConfigurationListener- Parameters:
itr- The test result- See Also:
IConfigurationListener.onConfigurationSkip(org.testng.ITestResult)
-
onConfigurationSuccess
public void onConfigurationSuccess(ITestResult itr)
Description copied from interface:IConfigurationListenerInvoked whenever a configuration method succeeded.- Specified by:
onConfigurationSuccessin interfaceIConfigurationListener- Parameters:
itr- The test result- See Also:
IConfigurationListener.onConfigurationSuccess(org.testng.ITestResult)
-
-