Package org.testng.internal
Class ExitCodeListener
- java.lang.Object
-
- org.testng.internal.ExitCodeListener
-
- All Implemented Interfaces:
IReporter
,ITestListener
,ITestNGListener
public class ExitCodeListener extends java.lang.Object implements ITestListener, IReporter
-
-
Constructor Summary
Constructors Constructor Description ExitCodeListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String outputDirectory)
Generate a report for the given suites into the specified output directory.ExitCode
getStatus()
boolean
hasTests()
void
onFinish(ITestContext context)
Invoked after all the tests have run and all their Configuration methods have been called.void
onStart(ITestContext context)
Invoked after the test class is instantiated and before any configuration method is called.void
onTestFailedButWithinSuccessPercentage(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.void
onTestFailure(ITestResult result)
Invoked each time a test fails.void
onTestSkipped(ITestResult result)
Invoked each time a test is skipped.void
onTestStart(ITestResult result)
Invoked each time before a test will be invoked.void
onTestSuccess(ITestResult result)
Invoked each time a test succeeds.
-
-
-
Field Detail
-
hasTests
private boolean hasTests
-
status
private final ExitCode status
-
-
Method Detail
-
getStatus
public ExitCode getStatus()
-
hasTests
public boolean hasTests()
-
generateReport
public void generateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String outputDirectory)
Description copied from interface:IReporter
Generate a report for the given suites into the specified output directory.- Specified by:
generateReport
in interfaceIReporter
-
onTestStart
public void onTestStart(ITestResult result)
Description copied from interface:ITestListener
Invoked each time before a test will be invoked. TheITestResult
is only partially filled with the references to class, method, start millis and status.- Specified by:
onTestStart
in interfaceITestListener
- Parameters:
result
- the partially filledITestResult
- See Also:
ITestResult.STARTED
-
onTestSuccess
public void onTestSuccess(ITestResult result)
Description copied from interface:ITestListener
Invoked each time a test succeeds.- Specified by:
onTestSuccess
in interfaceITestListener
- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.SUCCESS
-
onTestFailure
public void onTestFailure(ITestResult result)
Description copied from interface:ITestListener
Invoked each time a test fails.- Specified by:
onTestFailure
in interfaceITestListener
- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.FAILURE
-
onTestSkipped
public void onTestSkipped(ITestResult result)
Description copied from interface:ITestListener
Invoked each time a test is skipped.- Specified by:
onTestSkipped
in interfaceITestListener
- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.SKIP
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(ITestResult result)
Description copied from interface:ITestListener
Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.- Specified by:
onTestFailedButWithinSuccessPercentage
in interfaceITestListener
- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.SUCCESS_PERCENTAGE_FAILURE
-
onStart
public void onStart(ITestContext context)
Description copied from interface:ITestListener
Invoked after the test class is instantiated and before any configuration method is called.- Specified by:
onStart
in interfaceITestListener
-
onFinish
public void onFinish(ITestContext context)
Description copied from interface:ITestListener
Invoked after all the tests have run and all their Configuration methods have been called.- Specified by:
onFinish
in interfaceITestListener
-
-