|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.testng.TestListenerAdapter
public class TestListenerAdapter
A simple ITestListener adapter that stores all the tests that were run. You can retrieve these results with the following methods: getPassedTests() getFailedTests() getSkippedTests() 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 Summary | |
---|---|
TestListenerAdapter()
|
Method Summary | |
---|---|
protected ITestNGMethod[] |
getAllTestMethods()
|
List<ITestResult> |
getConfigurationFailures()
|
List<ITestResult> |
getConfigurationSkips()
|
List<ITestResult> |
getFailedButWithinSuccessPercentageTests()
|
List<ITestResult> |
getFailedTests()
|
List<ITestResult> |
getPassedTests()
|
List<ITestResult> |
getSkippedTests()
|
List<ITestContext> |
getTestContexts()
|
void |
onConfigurationFailure(ITestResult itr)
|
void |
onConfigurationSkip(ITestResult itr)
|
void |
onConfigurationSuccess(ITestResult itr)
|
void |
onFinish(ITestContext testContext)
Invoked after all the tests have run and all their Configuration methods have been called. |
void |
onStart(ITestContext testContext)
Invoked after the test class is instantiated and before any configuration method is called. |
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 |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TestListenerAdapter()
Method Detail |
---|
public void onTestSuccess(ITestResult tr)
ITestListener
onTestSuccess
in interface ITestListener
tr
- ITestResult
containing information about the run testITestResult.SUCCESS
public void onTestFailure(ITestResult tr)
ITestListener
onTestFailure
in interface ITestListener
tr
- ITestResult
containing information about the run testITestResult.FAILURE
public void onTestSkipped(ITestResult tr)
ITestListener
onTestSkipped
in interface ITestListener
tr
- ITestResult
containing information about the run testITestResult.SKIP
public void onTestFailedButWithinSuccessPercentage(ITestResult tr)
ITestListener
onTestFailedButWithinSuccessPercentage
in interface ITestListener
tr
- ITestResult
containing information about the run testITestResult.SUCCESS_PERCENTAGE_FAILURE
protected ITestNGMethod[] getAllTestMethods()
public void onStart(ITestContext testContext)
ITestListener
onStart
in interface ITestListener
public void onFinish(ITestContext testContext)
ITestListener
onFinish
in interface ITestListener
public List<ITestResult> getFailedButWithinSuccessPercentageTests()
public List<ITestResult> getFailedTests()
public List<ITestResult> getPassedTests()
public List<ITestResult> getSkippedTests()
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)
ITestListener
ITestResult
is only partially filled with the references to
class, method, start millis and status.
onTestStart
in interface ITestListener
result
- the partially filled ITestResult
ITestResult.STARTED
public List<ITestContext> getTestContexts()
public List<ITestResult> getConfigurationFailures()
public void onConfigurationFailure(ITestResult itr)
onConfigurationFailure
in interface org.testng.internal.IConfigurationListener
IConfigurationListener.onConfigurationFailure(org.testng.ITestResult)
public List<ITestResult> getConfigurationSkips()
public void onConfigurationSkip(ITestResult itr)
onConfigurationSkip
in interface org.testng.internal.IConfigurationListener
IConfigurationListener.onConfigurationSkip(org.testng.ITestResult)
public void onConfigurationSuccess(ITestResult itr)
onConfigurationSuccess
in interface org.testng.internal.IConfigurationListener
IConfigurationListener.onConfigurationSuccess(org.testng.ITestResult)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |