org.apache.maven.surefire.testng
Class TestNGReporter

java.lang.Object
  extended by org.apache.maven.surefire.testng.TestNGReporter
All Implemented Interfaces:
org.testng.ISuiteListener, org.testng.ITestListener

public class TestNGReporter
extends java.lang.Object
implements org.testng.ITestListener, org.testng.ISuiteListener

Listens for and provides and adaptor layer so that TestNG tests can report their status to the current ReporterManager.

Author:
jkuhnert

Field Summary
private  java.util.ResourceBundle bundle
           
protected  org.apache.maven.surefire.report.ReporterManager reportManager
          core Surefire reporting
private  java.lang.Object source
           
 
Constructor Summary
TestNGReporter(org.apache.maven.surefire.report.ReporterManager reportManager, org.apache.maven.surefire.suite.SurefireTestSuite source)
          Constructs a new instance that will listen to test updates from a TestNG class instance.
 
Method Summary
private static java.lang.String getUserFriendlyTestName(org.testng.ITestResult result)
           
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
 void onFinish(org.testng.ISuite suite)
           
 void onFinish(org.testng.ITestContext context)
           
 void onStart(org.testng.ISuite suite)
           
 void onStart(org.testng.ITestContext context)
           
 void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)
           
 void onTestFailure(org.testng.ITestResult result)
           
 void onTestSkipped(org.testng.ITestResult result)
           
 void onTestStart(org.testng.ITestResult result)
           
 void onTestSuccess(org.testng.ITestResult result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundle

private java.util.ResourceBundle bundle

reportManager

protected org.apache.maven.surefire.report.ReporterManager reportManager
core Surefire reporting


source

private java.lang.Object source
Constructor Detail

TestNGReporter

public TestNGReporter(org.apache.maven.surefire.report.ReporterManager reportManager,
                      org.apache.maven.surefire.suite.SurefireTestSuite source)
Constructs a new instance that will listen to test updates from a TestNG class instance.

It is assumed that the requisite 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:
onTestStart in interface org.testng.ITestListener

onTestSuccess

public void onTestSuccess(org.testng.ITestResult result)
Specified by:
onTestSuccess in interface org.testng.ITestListener

onTestFailure

public void onTestFailure(org.testng.ITestResult result)
Specified by:
onTestFailure in interface org.testng.ITestListener

getUserFriendlyTestName

private static java.lang.String getUserFriendlyTestName(org.testng.ITestResult result)

onTestSkipped

public void onTestSkipped(org.testng.ITestResult result)
Specified by:
onTestSkipped in interface org.testng.ITestListener

onTestFailedButWithinSuccessPercentage

public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)
Specified by:
onTestFailedButWithinSuccessPercentage in interface org.testng.ITestListener

onStart

public void onStart(org.testng.ITestContext context)
Specified by:
onStart in interface org.testng.ITestListener

onFinish

public void onFinish(org.testng.ITestContext context)
Specified by:
onFinish in interface org.testng.ITestListener

onFinish

public void onFinish(org.testng.ISuite suite)
Specified by:
onFinish in interface org.testng.ISuiteListener

onStart

public void onStart(org.testng.ISuite suite)
Specified by:
onStart in interface org.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 -
defaultValue -