Package org.apache.maven.surefire.testng
Class TestNGReporter
java.lang.Object
org.apache.maven.surefire.testng.TestNGReporter
- All Implemented Interfaces:
TestOutputReceiver<OutputReportEntry>,RunModeSetter,org.testng.ISuiteListener,org.testng.ITestListener,org.testng.ITestNGListener
- Direct Known Subclasses:
ConfigurationAwareTestNGReporter
public class TestNGReporter
extends Object
implements TestOutputReceiver<OutputReportEntry>, org.testng.ITestListener, org.testng.ISuiteListener, RunModeSetter
Listens for and provides and adaptor layer so that
TestNG tests can report their status to the current
RunListener.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassMethodIndexerprivate final TestReportListener<TestOutputReportEntry> private RunMode -
Constructor Summary
ConstructorsConstructorDescriptionTestNGReporter(TestReportListener<TestOutputReportEntry> reportManager) Constructs a new instance that will listen to test updates from aTestNGclass instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected final RunListenerprivate static StringgroupString(String[] groups, 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) voidsetRunMode(RunMode runMode) private static StringtestName(org.testng.ITestResult result) Acquire a better representation of the test name that includes parameters and the invocation count, if there are any parametersvoidwriteTestOutput(OutputReportEntry reportEntry) Forwards process output from the running test-case into the reporting systemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.ITestListener
onTestFailedWithTimeout
-
Field Details
-
classMethodIndexer
-
reporter
-
runMode
-
-
Constructor Details
-
TestNGReporter
Constructs a new instance that will listen to test updates from aTestNGclass instance.
It is assumed that the requisiteTestNG.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 Details
-
getRunListener
-
onTestStart
public void onTestStart(org.testng.ITestResult result) - Specified by:
onTestStartin interfaceorg.testng.ITestListener
-
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
-
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
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) -
testName
Acquire a better representation of the test name that includes parameters and the invocation count, if there are any parameters- Parameters:
result- the test result to extract from- Returns:
- a descriptive name for the test
-
setRunMode
- Specified by:
setRunModein interfaceRunModeSetter
-
writeTestOutput
Description copied from interface:TestOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceTestOutputReceiver<OutputReportEntry>- Parameters:
reportEntry- wraps test output with descriptive information of the output
-