org.apache.maven.surefire.report
Class ReporterManager

java.lang.Object
  extended by org.apache.maven.surefire.report.ReporterManager

public class ReporterManager
extends Object

A reporting front-end for providers.

Synchronization/Threading note:

This design is really only good for single-threaded test execution. Although it is currently used by multi-threaded providers too, the design does not really make sense (and is probably buggy).

This is because to get correct results, the client basically needs to do something like this: synchronized( ReporterManger.getClass()){ reporterManager.runStarted() reporterManager.testSetStarting() reporterManager.testStarting() reporterManager.testSucceeded() reporterManager.testSetCompleted() reporterManager.runCompleted() }

This is because the underlying providers are singletons and keep state, if you remove the outer synchronized block, you may get mixups between results from different tests; although the end result (total test count etc) should probably be correct.

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.

Please also note that the synchronization requirements of this interface severely limit the concurrency potential of all the parallel surefire providers, especially when runnning non-io bound tests,


Constructor Summary
ReporterManager(List reports, RunStatistics runStatisticsForThis)
           
 
Method Summary
 void reset()
           
 void runCompleted()
           
 void runStarting()
           
 void testError(ReportEntry reportEntry)
           
 void testError(ReportEntry reportEntry, String stdOutLog, String stdErrLog)
           
 void testFailed(ReportEntry reportEntry)
           
 void testFailed(ReportEntry reportEntry, String stdOutLog, String stdErrLog)
           
 void testSetCompleted(ReportEntry report)
           
 void testSetStarting(ReportEntry report)
           
 void testSkipped(ReportEntry report)
           
 void testStarting(ReportEntry report)
           
 void testSucceeded(ReportEntry report)
           
 void writeConsoleMessage(String message)
           
 void writeFooter(String footer)
           
 void writeMessage(String message)
           
 
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)
Method Detail

writeMessage

public void writeMessage(String message)

writeConsoleMessage

public void writeConsoleMessage(String message)

runStarting

public void runStarting()

runCompleted

public void runCompleted()

writeFooter

public void writeFooter(String footer)

testSetStarting

public void testSetStarting(ReportEntry report)
                     throws ReporterException
Throws:
ReporterException

testSetCompleted

public void testSetCompleted(ReportEntry report)

testStarting

public void testStarting(ReportEntry report)

testSucceeded

public void testSucceeded(ReportEntry report)

testError

public void testError(ReportEntry reportEntry)

testError

public void testError(ReportEntry reportEntry,
                      String stdOutLog,
                      String stdErrLog)

testFailed

public void testFailed(ReportEntry reportEntry)

testFailed

public void testFailed(ReportEntry reportEntry,
                       String stdOutLog,
                       String stdErrLog)

testSkipped

public void testSkipped(ReportEntry report)

reset

public void reset()


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