org.apache.maven.surefire.report
Class AbstractReporter

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

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

Version:
$Id: AbstractReporter.java 1062022 2011-01-21 20:51:22Z krosenvold $
Author:
Jason van Zyl

Field Summary
protected  int completedCount
           
protected  int errors
           
protected  int failures
           
protected static java.lang.String NL
           
protected  int skipped
           
protected  long testSetStartTime
           
 
Constructor Summary
protected AbstractReporter(java.lang.Boolean trimStackTrace)
           
protected AbstractReporter(ReporterConfiguration reporterConfiguration)
           
 
Method Summary
protected  void deleteIfExisting(java.io.File reportFile)
           
protected  java.lang.String elapsedTimeAsString(long runTime)
           
protected  long getActualRunTime(ReportEntry reportEntry)
           
 int getNumErrors()
           
 int getNumFailures()
           
 int getNumSkipped()
           
 int getNumTests()
           
protected  java.lang.String getStackTrace(ReportEntry report)
          Returns stacktrace as String.
protected  boolean isTimedOut()
           
 void reset()
          Restores the instance of the reporter, making the instance re-usable for a subsequent run in the same thread.
 void runCompleted()
           
 void runStarting()
           
 void testAssumptionFailure(ReportEntry report)
          Event fired when a test assumption failure was encountered.
 void testError(ReportEntry report)
          Event fired when a test ended with an error (non anticipated problem)
 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)
          Event fired when a test ended with a failure (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 testSetCompleted(ReportEntry report)
          Indicates end of a given test-set
 void testSetStarting(ReportEntry report)
          Indicates the start of a given test-set
 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
writeDetailMessage, writeMessage
 
Methods inherited from interface org.apache.maven.surefire.report.ReportWriter
writeDetailMessage, writeMessage
 

Field Detail

completedCount

protected int completedCount

errors

protected int errors

failures

protected int failures

NL

protected static final java.lang.String NL

testSetStartTime

protected long testSetStartTime

skipped

protected int skipped
Constructor Detail

AbstractReporter

protected AbstractReporter(ReporterConfiguration reporterConfiguration)

AbstractReporter

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

isTimedOut

protected boolean isTimedOut()

writeFooter

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

runStarting

public void runStarting()

runCompleted

public void runCompleted()

testSetStarting

public void testSetStarting(ReportEntry report)
                     throws ReporterException
Description copied from interface: Reporter
Indicates the start of a given test-set

Specified by:
testSetStarting in interface Reporter
Specified by:
testSetStarting in interface ReportWriter
Parameters:
report - the report entry describing the testset
Throws:
ReporterException - When reporting fails

testSetCompleted

public void testSetCompleted(ReportEntry report)
                      throws ReporterException
Description copied from interface: Reporter
Indicates end of a given test-set

Specified by:
testSetCompleted in interface Reporter
Specified by:
testSetCompleted in interface ReportWriter
Parameters:
report - the report entry describing the testset
Throws:
ReporterException - When reporting fails

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
Specified by:
testStarting in interface ReportWriter
Parameters:
report - The report entry to log for

testSucceeded

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

Specified by:
testSucceeded in interface Reporter
Specified by:
testSucceeded in interface ReportWriter
Parameters:
report - The report entry to log for

testSkipped

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

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
Specified by:
testError in interface ReportWriter
Parameters:
report - The report entry to log for
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
Specified by:
testFailed in interface ReportWriter
Parameters:
report - The report entry to log for
stdOut - standard output from the test case
stdErr - error output from the test case

getNumErrors

public int getNumErrors()

getNumSkipped

public int getNumSkipped()

getNumFailures

public int getNumFailures()

getNumTests

public int getNumTests()

reset

public void reset()
Description copied from interface: Reporter
Restores the instance of the reporter, making the instance re-usable for a subsequent run in the same thread.

Specified by:
reset in interface Reporter
Specified by:
reset in interface ReportWriter

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.

getActualRunTime

protected long getActualRunTime(ReportEntry reportEntry)

testError

public void testError(ReportEntry report)
Description copied from interface: Reporter
Event fired when a test ended with an error (non anticipated problem)

Specified by:
testError in interface Reporter
Specified by:
testError in interface ReportWriter
Parameters:
report - The report entry to log for

testFailed

public void testFailed(ReportEntry report)
Description copied from interface: Reporter
Event fired when a test ended with a failure (anticipated problem)

Specified by:
testFailed in interface Reporter
Specified by:
testFailed in interface ReportWriter
Parameters:
report - The report entry to log for

testAssumptionFailure

public void testAssumptionFailure(ReportEntry report)
Description copied from interface: Reporter
Event fired when a test assumption failure was encountered. An assumption failure indicates that the test is not relevant

Specified by:
testAssumptionFailure in interface Reporter
Parameters:
report - The report entry to log for

deleteIfExisting

protected void deleteIfExisting(java.io.File reportFile)


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