Package org.testng.internal
Class ExitCodeListener
java.lang.Object
org.testng.internal.ExitCodeListener
- All Implemented Interfaces:
IExecutionListener
,IReporter
,ITestListener
,ITestNGListener
public class ExitCodeListener
extends Object
implements ITestListener, IReporter, IExecutionListener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Generate a report for the given suites into the specified output directory.boolean
void
Invoked once all the suites have been run.void
onFinish
(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.void
onStart
(ITestContext context) Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.void
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.testng.IExecutionListener
onExecutionStart
Methods inherited from interface org.testng.ITestListener
onTestFailedWithTimeout
-
Field Details
-
hasTests
private boolean hasTests -
status
-
failIfAllTestsSkipped
private boolean failIfAllTestsSkipped
-
-
Constructor Details
-
ExitCodeListener
public ExitCodeListener()
-
-
Method Details
-
failIfAllTestsSkipped
public void failIfAllTestsSkipped() -
getStatus
-
noTestsFound
public boolean noTestsFound() -
generateReport
Description copied from interface:IReporter
Generate a report for the given suites into the specified output directory.- Specified by:
generateReport
in interfaceIReporter
- Parameters:
xmlSuites
- The list ofXmlSuite
suites
- The list ofISuite
outputDirectory
- The output directory
-
onTestStart
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:
-
onTestSuccess
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:
-
onTestFailure
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:
-
onTestSkipped
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:
-
onTestFailedButWithinSuccessPercentage
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:
-
onStart
Description copied from interface:ITestListener
Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.- Specified by:
onStart
in interfaceITestListener
- Parameters:
context
- The test context
-
onFinish
Description copied from interface:ITestListener
Invoked 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:
onFinish
in interfaceITestListener
- Parameters:
context
- The test context
-
onExecutionFinish
public void onExecutionFinish()Description copied from interface:IExecutionListener
Invoked once all the suites have been run.- Specified by:
onExecutionFinish
in interfaceIExecutionListener
-