org.apache.maven.surefire.report
Class AbstractTextReporter

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

public abstract class AbstractTextReporter
extends AbstractReporter

Text based reporter.

Author:
Brett Porter

Field Summary
protected static String BRIEF
           
protected static String PLAIN
           
protected static String SUMMARY
           
protected  PrintWriter writer
           
 
Constructor Summary
protected AbstractTextReporter(PrintWriter writer, String format, ReporterConfiguration reporterConfiguration)
           
protected AbstractTextReporter(ReporterConfiguration reporterConfiguration, String format)
           
 
Method Summary
protected  String getElapsedTimeSummary(ReportEntry report)
           
protected  String getOutput(ReportEntry report, String msg)
           
protected  String getTestSetSummary(ReportEntry report)
           
static boolean isTestSetCompletedMessage(String message)
          Check if the String passed as argument is a "test set completed" message.
 void reset()
          Restores the instance of the reporter, making the instance re-usable for a subsequent run in the same thread.
 void setWriter(PrintWriter writer)
           
 void testError(ReportEntry report, String stdOut, String stdErr)
          Event fired when a test ended with an error (non anticipated problem)
 void testFailed(ReportEntry report, String stdOut, 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 testSucceeded(ReportEntry report)
          Event fired when a test ended successfully
 void writeDetailMessage(String message)
          Writes a detailed message that will not necessarily be displayed in all channels.
 void writeMessage(String message)
          Writes a message that will be displayed in all free-text format reporters.
 
Methods inherited from class org.apache.maven.surefire.report.AbstractReporter
runCompleted, runStarting, testAssumptionFailure, testError, testFailed, testStarting, writeFooter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BRIEF

protected static final String BRIEF
See Also:
Constant Field Values

PLAIN

protected static final String PLAIN
See Also:
Constant Field Values

SUMMARY

protected static final String SUMMARY
See Also:
Constant Field Values

writer

protected PrintWriter writer
Constructor Detail

AbstractTextReporter

protected AbstractTextReporter(ReporterConfiguration reporterConfiguration,
                               String format)

AbstractTextReporter

protected AbstractTextReporter(PrintWriter writer,
                               String format,
                               ReporterConfiguration reporterConfiguration)
Method Detail

setWriter

public void setWriter(PrintWriter writer)

writeMessage

public void writeMessage(String message)
Description copied from interface: Reporter
Writes a message that will be displayed in all free-text format reporters. These messages will be output regardless, as opposed to #writeDetailMessage, which is controlled by reportFormat.

Parameters:
message - The message to write.

writeDetailMessage

public void writeDetailMessage(String message)
Description copied from interface: Reporter
Writes a detailed message that will not necessarily be displayed in all channels. This is controlled by reportFormat attribute on the plugin.

Parameters:
message - The message to write

testSucceeded

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

Specified by:
testSucceeded in interface Reporter
Overrides:
testSucceeded in class AbstractReporter
Parameters:
report - The report entry to log for

testSkipped

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

testError

public void testError(ReportEntry report,
                      String stdOut,
                      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
Overrides:
testError in class AbstractReporter
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,
                       String stdOut,
                       String stdErr)
Description copied from interface: Reporter
Event fired when a test ended with a failure (anticipated problem)

Specified by:
testFailed in interface Reporter
Overrides:
testFailed in class AbstractReporter
Parameters:
report - The report entry to log for
stdOut - standard output from the test case
stdErr - error output from the test case

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
Overrides:
testSetStarting in class AbstractReporter
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
Overrides:
testSetCompleted in class AbstractReporter
Parameters:
report - the report entry describing the testset
Throws:
ReporterException - When reporting fails

getTestSetSummary

protected String getTestSetSummary(ReportEntry report)

getElapsedTimeSummary

protected String getElapsedTimeSummary(ReportEntry report)

getOutput

protected String getOutput(ReportEntry report,
                           String msg)

isTestSetCompletedMessage

public static boolean isTestSetCompletedMessage(String message)
Check if the String passed as argument is a "test set completed" message.

Parameters:
message - the message to check
Returns:
true if it is a "test set completed" message

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
Overrides:
reset in class AbstractReporter


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