public class TestListenerAdapter extends Object implements IResultListener2
If you extend this class in order to override any of these methods, remember to call their super equivalent if you want this list of tests to be maintained.
| Constructor and Description |
|---|
TestListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeConfiguration(ITestResult tr)
Invoked before a configuration method is invoked.
|
protected ITestNGMethod[] |
getAllTestMethods() |
List<ITestResult> |
getConfigurationFailures() |
List<ITestResult> |
getConfigurationSkips() |
List<ITestResult> |
getFailedButWithinSuccessPercentageTests() |
List<ITestResult> |
getFailedTests() |
List<ITestResult> |
getPassedTests() |
List<ITestResult> |
getSkippedTests() |
List<ITestContext> |
getTestContexts() |
Collection<ITestResult> |
getTimedoutTests() |
void |
onConfigurationFailure(ITestResult itr)
Invoked whenever a configuration method failed.
|
void |
onConfigurationSkip(ITestResult itr)
Invoked whenever a configuration method was skipped.
|
void |
onConfigurationSuccess(ITestResult itr)
Invoked whenever a configuration method succeeded.
|
void |
onFinish(ITestContext testContext)
Invoked after all the test methods belonging to the classes inside the <test> tag have
run and all their Configuration methods have been called.
|
void |
onStart(ITestContext testContext)
Invoked before running all the test methods belonging to the classes inside the <test>
tag and calling all their Configuration methods.
|
void |
onTestFailedButWithinSuccessPercentage(ITestResult tr)
Invoked each time a method fails but has been annotated with successPercentage and this failure
still keeps it within the success percentage requested.
|
void |
onTestFailedWithTimeout(ITestResult tr)
Invoked each time a test fails due to a timeout.
|
void |
onTestFailure(ITestResult tr)
Invoked each time a test fails.
|
void |
onTestSkipped(ITestResult tr)
Invoked each time a test is skipped.
|
void |
onTestStart(ITestResult result)
Invoked each time before a test will be invoked.
|
void |
onTestSuccess(ITestResult tr)
Invoked each time a test succeeds.
|
void |
setAllTestMethods(List<ITestNGMethod> allTestMethods) |
void |
setFailedButWithinSuccessPercentageTests(List<ITestResult> failedButWithinSuccessPercentageTests) |
void |
setFailedTests(List<ITestResult> failedTests) |
void |
setPassedTests(List<ITestResult> passedTests) |
void |
setSkippedTests(List<ITestResult> skippedTests) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbeforeConfiguration, onConfigurationFailure, onConfigurationSkip, onConfigurationSuccesspublic void onTestSuccess(ITestResult tr)
ITestListeneronTestSuccess in interface ITestListenertr - ITestResult containing information about the run testITestResult.SUCCESSpublic void onTestFailure(ITestResult tr)
ITestListeneronTestFailure in interface ITestListenertr - ITestResult containing information about the run testITestResult.FAILUREpublic void onTestSkipped(ITestResult tr)
ITestListeneronTestSkipped in interface ITestListenertr - ITestResult containing information about the run testITestResult.SKIPpublic void onTestFailedWithTimeout(ITestResult tr)
ITestListeneronTestFailedWithTimeout in interface ITestListenertr - ITestResult containing information about the run testpublic void onTestFailedButWithinSuccessPercentage(ITestResult tr)
ITestListeneronTestFailedButWithinSuccessPercentage in interface ITestListenertr - ITestResult containing information about the run testITestResult.SUCCESS_PERCENTAGE_FAILUREprotected ITestNGMethod[] getAllTestMethods()
public void onStart(ITestContext testContext)
ITestListeneronStart in interface ITestListenertestContext - The test contextpublic void onFinish(ITestContext testContext)
ITestListeneronFinish in interface ITestListenertestContext - The test contextpublic List<ITestResult> getFailedButWithinSuccessPercentageTests()
public List<ITestResult> getFailedTests()
public List<ITestResult> getPassedTests()
public List<ITestResult> getSkippedTests()
public Collection<ITestResult> getTimedoutTests()
public void setAllTestMethods(List<ITestNGMethod> allTestMethods)
allTestMethods - The allTestMethods to set.public void setFailedButWithinSuccessPercentageTests(List<ITestResult> failedButWithinSuccessPercentageTests)
failedButWithinSuccessPercentageTests - The failedButWithinSuccessPercentageTests to set.public void setFailedTests(List<ITestResult> failedTests)
failedTests - The failedTests to set.public void setPassedTests(List<ITestResult> passedTests)
passedTests - The passedTests to set.public void setSkippedTests(List<ITestResult> skippedTests)
skippedTests - The skippedTests to set.public void onTestStart(ITestResult result)
ITestListenerITestResult is only partially
filled with the references to class, method, start millis and status.onTestStart in interface ITestListenerresult - the partially filled ITestResultITestResult.STARTEDpublic List<ITestContext> getTestContexts()
public List<ITestResult> getConfigurationFailures()
public void onConfigurationFailure(ITestResult itr)
IConfigurationListeneronConfigurationFailure in interface IConfigurationListeneritr - The test resultIConfigurationListener.onConfigurationFailure(org.testng.ITestResult)public List<ITestResult> getConfigurationSkips()
public void beforeConfiguration(ITestResult tr)
IConfigurationListenerbeforeConfiguration in interface IConfigurationListenertr - The test resultpublic void onConfigurationSkip(ITestResult itr)
IConfigurationListeneronConfigurationSkip in interface IConfigurationListeneritr - The test resultIConfigurationListener.onConfigurationSkip(org.testng.ITestResult)public void onConfigurationSuccess(ITestResult itr)
IConfigurationListeneronConfigurationSuccess in interface IConfigurationListeneritr - The test resultIConfigurationListener.onConfigurationSuccess(org.testng.ITestResult)Copyright © 2025. All rights reserved.