Package org.apache.maven.surefire.testng
Class TestNGReporter
- java.lang.Object
-
- org.apache.maven.surefire.testng.TestNGReporter
-
- All Implemented Interfaces:
org.testng.ISuiteListener,org.testng.ITestListener,org.testng.ITestNGListener
- Direct Known Subclasses:
ConfigurationAwareTestNGReporter
public class TestNGReporter extends java.lang.Object implements org.testng.ITestListener, org.testng.ISuiteListenerListens for and provides and adaptor layer so that TestNG tests can report their status to the currentRunListener.
-
-
Field Summary
Fields Modifier and Type Field Description private RunListenerreporter
-
Constructor Summary
Constructors Constructor Description TestNGReporter(RunListener reportManager)Constructs a new instance that will listen to test updates from aTestNGclass instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetSource(org.testng.ITestResult result)private static java.lang.StringgetUserFriendlyTestName(org.testng.ITestResult result)private static java.lang.StringgroupString(java.lang.String[] groups, java.lang.String defaultValue)Creates a string out of the list of testng groups in the form ofvoidonConfigurationFailure(org.testng.ITestResult result)voidonConfigurationSkip(org.testng.ITestResult result)voidonConfigurationSuccess(org.testng.ITestResult result)voidonFinish(org.testng.ISuite suite)voidonFinish(org.testng.ITestContext context)voidonStart(org.testng.ISuite suite)voidonStart(org.testng.ITestContext context)voidonTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)voidonTestFailure(org.testng.ITestResult result)voidonTestSkipped(org.testng.ITestResult result)voidonTestStart(org.testng.ITestResult result)voidonTestSuccess(org.testng.ITestResult result)
-
-
-
Field Detail
-
reporter
private final RunListener reporter
-
-
Constructor Detail
-
TestNGReporter
public TestNGReporter(RunListener reportManager)
Constructs a new instance that will listen to test updates from aTestNGclass instance.
It is assumed that the requisiteorg.testng.TestNG#addListener(ITestListener)method call has already associated with this instance before the test suite is run.- Parameters:
reportManager- Instance to report suite status to
-
-
Method Detail
-
onTestStart
public void onTestStart(org.testng.ITestResult result)
- Specified by:
onTestStartin interfaceorg.testng.ITestListener
-
getSource
private java.lang.String getSource(org.testng.ITestResult result)
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult result)
- Specified by:
onTestSuccessin interfaceorg.testng.ITestListener
-
onTestFailure
public void onTestFailure(org.testng.ITestResult result)
- Specified by:
onTestFailurein interfaceorg.testng.ITestListener
-
getUserFriendlyTestName
private static java.lang.String getUserFriendlyTestName(org.testng.ITestResult result)
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult result)
- Specified by:
onTestSkippedin interfaceorg.testng.ITestListener
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)
- Specified by:
onTestFailedButWithinSuccessPercentagein interfaceorg.testng.ITestListener
-
onStart
public void onStart(org.testng.ITestContext context)
- Specified by:
onStartin interfaceorg.testng.ITestListener
-
onFinish
public void onFinish(org.testng.ITestContext context)
- Specified by:
onFinishin interfaceorg.testng.ITestListener
-
onStart
public void onStart(org.testng.ISuite suite)
- Specified by:
onStartin interfaceorg.testng.ISuiteListener
-
onFinish
public void onFinish(org.testng.ISuite suite)
- Specified by:
onFinishin interfaceorg.testng.ISuiteListener
-
groupString
private static java.lang.String groupString(java.lang.String[] groups, java.lang.String defaultValue)Creates a string out of the list of testng groups in the form of"group1,group2,group3"
.- Parameters:
groups- The groups being rundefaultValue- The default to use if no groups- Returns:
- a string describing the groups
-
onConfigurationFailure
public void onConfigurationFailure(org.testng.ITestResult result)
-
onConfigurationSkip
public void onConfigurationSkip(org.testng.ITestResult result)
-
onConfigurationSuccess
public void onConfigurationSuccess(org.testng.ITestResult result)
-
-