org.apache.maven.surefire.report
Class AbstractReporter

java.lang.Object
  extended by org.apache.maven.surefire.report.AbstractReporter
All Implemented Interfaces:
Reporter
Direct Known Subclasses:
AbstractTextReporter, XMLReporter

public abstract class AbstractReporter
extends java.lang.Object
implements Reporter

Version:
$Id: AbstractReporter.java 510866 2007-02-23 08:13:49Z brett $
Author:
Jason van Zyl

Field Summary
protected  int completedCount
           
protected  long endTime
           
protected  int errors
           
protected  int failures
           
protected static java.lang.String NL
           
protected  int skipped
           
protected  long startTime
           
protected  long testSetStartTime
           
 
Constructor Summary
protected AbstractReporter(java.lang.Boolean trimStackTrace)
           
 
Method Summary
protected  java.lang.String elapsedTimeAsString(long runTime)
           
 java.util.Collection getErrorSources()
          Gives the source(s) that causes the error(s).
 java.util.Collection getFailureSources()
          Gives the source(s) that causes the failures(s).
 int getNumErrors()
          Get the number of errors
 int getNumFailures()
          Get the number of failures
 int getNumSkipped()
          Get the number of tests skipped
 int getNumTests()
          Get the number of tests
protected  java.lang.String getStackTrace(ReportEntry report)
          Returns stacktrace as String.
 void reset()
           
 void runAborted(ReportEntry report)
           
 void runCompleted()
           
 void runStarting(int testCount)
           
 void runStopped()
           
 void testError(ReportEntry report, java.lang.String stdOut, java.lang.String stdErr)
          Event fired when a test ended with an error (non anticipated problem)
 void testFailed(ReportEntry report, java.lang.String stdOut, java.lang.String stdErr)
          Event fired when a test ended with a failure (anticipated problem)
 void testSetAborted(ReportEntry report)
           
 void testSetCompleted(ReportEntry report)
           
 void testSetStarting(ReportEntry report)
           
 void testSkipped(ReportEntry report)
           
 void testStarting(ReportEntry report)
          Event fired when a test is about to start
 void testSucceeded(ReportEntry report)
          Event fired when a test ended successfully
 void writeFooter(java.lang.String footer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.surefire.report.Reporter
writeMessage
 

Field Detail

completedCount

protected int completedCount

errors

protected int errors

failures

protected int failures

startTime

protected long startTime

endTime

protected long endTime

NL

protected static final java.lang.String NL

testSetStartTime

protected long testSetStartTime

skipped

protected int skipped
Constructor Detail

AbstractReporter

protected AbstractReporter(java.lang.Boolean trimStackTrace)
Method Detail

writeFooter

public void writeFooter(java.lang.String footer)
Specified by:
writeFooter in interface Reporter

runStarting

public void runStarting(int testCount)
Specified by:
runStarting in interface Reporter

runCompleted

public void runCompleted()
Specified by:
runCompleted in interface Reporter

runStopped

public void runStopped()
Specified by:
runStopped in interface Reporter

runAborted

public void runAborted(ReportEntry report)
Specified by:
runAborted in interface Reporter

testSetStarting

public void testSetStarting(ReportEntry report)
                     throws ReporterException
Specified by:
testSetStarting in interface Reporter
Throws:
ReporterException

testSetCompleted

public void testSetCompleted(ReportEntry report)
                      throws ReporterException
Specified by:
testSetCompleted in interface Reporter
Throws:
ReporterException

testSetAborted

public void testSetAborted(ReportEntry report)
Specified by:
testSetAborted in interface Reporter

getFailureSources

public java.util.Collection getFailureSources()
Description copied from interface: Reporter
Gives the source(s) that causes the failures(s).

Specified by:
getFailureSources in interface Reporter
Returns:
The source(s).
See Also:
Reporter.getFailureSources()

getErrorSources

public java.util.Collection getErrorSources()
Description copied from interface: Reporter
Gives the source(s) that causes the error(s).

Specified by:
getErrorSources in interface Reporter
Returns:
The source(s).
See Also:
Reporter.getErrorSources()

testStarting

public void testStarting(ReportEntry report)
Description copied from interface: Reporter
Event fired when a test is about to start

Specified by:
testStarting in interface Reporter

testSucceeded

public void testSucceeded(ReportEntry report)
Description copied from interface: Reporter
Event fired when a test ended successfully

Specified by:
testSucceeded in interface Reporter

testSkipped

public void testSkipped(ReportEntry report)
Specified by:
testSkipped in interface Reporter

testError

public void testError(ReportEntry report,
                      java.lang.String stdOut,
                      java.lang.String stdErr)
Description copied from interface: Reporter
Event fired when a test ended with an error (non anticipated problem)

Specified by:
testError in interface Reporter
stdOut - standard output from the test case
stdErr - error output from the test case

testFailed

public void testFailed(ReportEntry report,
                       java.lang.String stdOut,
                       java.lang.String stdErr)
Description copied from interface: Reporter
Event fired when a test ended with a failure (anticipated problem)

Specified by:
testFailed in interface Reporter
stdOut - standard output from the test case
stdErr - error output from the test case

getNumErrors

public int getNumErrors()
Description copied from interface: Reporter
Get the number of errors

Specified by:
getNumErrors in interface Reporter
Returns:

getNumSkipped

public int getNumSkipped()
Description copied from interface: Reporter
Get the number of tests skipped

Specified by:
getNumSkipped in interface Reporter
Returns:

getNumFailures

public int getNumFailures()
Description copied from interface: Reporter
Get the number of failures

Specified by:
getNumFailures in interface Reporter
Returns:

getNumTests

public int getNumTests()
Description copied from interface: Reporter
Get the number of tests

Specified by:
getNumTests in interface Reporter
Returns:

reset

public void reset()
Specified by:
reset in interface Reporter

elapsedTimeAsString

protected java.lang.String elapsedTimeAsString(long runTime)

getStackTrace

protected java.lang.String getStackTrace(ReportEntry report)
Returns stacktrace as String.

Parameters:
report - ReportEntry object.
Returns:
stacktrace as string.


Copyright © 2004-2008 Apache Software Foundation. All Rights Reserved.