org.apache.maven.surefire.report
Class ReporterManager

java.lang.Object
  extended by org.apache.maven.surefire.report.ReporterManager
All Implemented Interfaces:
Reporter, ReportWriter, RunReporter

public class ReporterManager
extends Object
implements Reporter, RunReporter, ReportWriter

A reporting front-end for providers.

Synchronization/Threading note:

This design is really only good for single-threaded test execution. With the use of the additional SynchronizedReporterManager you can get a buggy version that sort-of supports multithreading.

The underlying providers are singletons and keep state per ReporterManager instance

The solution to this problem involves making a clearer separation between test-result collection and reporting, preferably removing singleton state approach out of the reporting interface.


Constructor Summary
ReporterManager(List reports, RunStatistics runStatisticsForThis, SystemStreamCapturer systemStreamCapturer)
           
 
Method Summary
 void reset()
          Restores the instance of the reporter, making the instance re-usable for a subsequent run in the same thread.
 void runCompleted()
          Indicates the end of the entire test run Only called on the first provider, and just by the ReporterFactory
 void runStarting()
          Indicates the start of the entire test run.
 void testAssumptionFailure(ReportEntry report)
          Event fired when a test assumption failure was encountered.
 void testError(ReportEntry reportEntry)
          Event fired when a test ended with an error (non anticipated problem)
 void testError(ReportEntry reportEntry, String stdOutLog, String stdErrLog)
          Event fired when a test ended with an error (non anticipated problem)
 void testFailed(ReportEntry reportEntry)
          Event fired when a test ended with a failure (anticipated problem)
 void testFailed(ReportEntry reportEntry, String stdOutLog, String stdErrLog)
          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 writeDetailMessage(String message)
          Writes a detailed message that will not necessarily be displayed in all channels.
 void writeFooter(String footer)
           
 void writeMessage(String message)
          Writes a message that will be displayed in all free-text format reporters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReporterManager

public ReporterManager(List reports,
                       RunStatistics runStatisticsForThis,
                       SystemStreamCapturer systemStreamCapturer)
Method Detail

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.

Specified by:
writeMessage in interface Reporter
Specified by:
writeMessage in interface ReportWriter
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.

Specified by:
writeDetailMessage in interface Reporter
Specified by:
writeDetailMessage in interface ReportWriter
Parameters:
message - The message to write

runStarting

public void runStarting()
Description copied from interface: RunReporter
Indicates the start of the entire test run. Only called on the first provider, and just by the ReporterFactory

Specified by:
runStarting in interface RunReporter

runCompleted

public void runCompleted()
Description copied from interface: RunReporter
Indicates the end of the entire test run Only called on the first provider, and just by the ReporterFactory

Specified by:
runCompleted in interface RunReporter

writeFooter

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

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)
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

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

testError

public void testError(ReportEntry reportEntry)
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:
reportEntry - The report entry to log for

testError

public void testError(ReportEntry reportEntry,
                      String stdOutLog,
                      String stdErrLog)
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:
reportEntry - The report entry to log for
stdOutLog - standard output from the test case
stdErrLog - error output from the test case

testFailed

public void testFailed(ReportEntry reportEntry)
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:
reportEntry - The report entry to log for

testFailed

public void testFailed(ReportEntry reportEntry,
                       String stdOutLog,
                       String stdErrLog)
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:
reportEntry - The report entry to log for
stdOutLog - standard output from the test case
stdErrLog - error output from the test case

testSkipped

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

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

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


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