org.apache.maven.surefire.junitcore
Class ConcurrentReporterManager

java.lang.Object
  extended by org.apache.maven.surefire.junitcore.ConcurrentReporterManager
All Implemented Interfaces:
Reporter
Direct Known Subclasses:
ClassesParallelRunListener, MethodsParallelRunListener

public abstract class ConcurrentReporterManager
extends Object
implements Reporter

Author:
Kristian Rosenvold

Field Summary
protected  Map<String,TestSet> classMethodCounts
           
protected  boolean reportImmediately
           
 
Constructor Summary
ConcurrentReporterManager(ReporterFactory reporterFactory, boolean reportImmediately, ReporterConfiguration reporterConfiguration, Map<String,TestSet> classMethodCounts)
           
 
Method Summary
abstract  void checkIfTestSetCanBeReported(TestSet testSetForTest)
           
static ConcurrentReporterManager createInstance(Map<String,TestSet> classMethodCounts, ReporterFactory reporterManagerFactory, ReporterConfiguration reporterConfiguration, boolean parallelClasses, boolean parallelBoth)
           
protected  void detachTestMethodFromThread()
           
protected  Reporter getReporterManager()
           
protected  org.apache.maven.surefire.junitcore.TestMethod getTestMethod()
           
protected  TestSet getTestSet(ReportEntry description)
           
 void reset()
          Restores the instance of the reporter, making the instance re-usable for a subsequent run in the same thread.
 void testAssumptionFailure(ReportEntry failure)
          Event fired when a test assumption failure was encountered.
 void testError(ReportEntry failure)
          Event fired when a test ended with an error (non anticipated problem)
 void testError(ReportEntry failure, String out, String err)
          Event fired when a test ended with an error (non anticipated problem)
 void testFailed(ReportEntry failure)
          Event fired when a test ended with a failure (anticipated problem)
 void testFailed(ReportEntry report, String stdOut, String stdErr)
          Event fired when a test ended with a failure (anticipated problem)
 void testSetCompleted(ReportEntry result)
          Indicates end of a given test-set
 void testSetStarting(ReportEntry description)
          Indicates the start of a given test-set
 void testSkipped(ReportEntry description)
           
 void testStarting(ReportEntry description)
          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
 

Field Detail

classMethodCounts

protected Map<String,TestSet> classMethodCounts

reportImmediately

protected final boolean reportImmediately
Constructor Detail

ConcurrentReporterManager

public ConcurrentReporterManager(ReporterFactory reporterFactory,
                                 boolean reportImmediately,
                                 ReporterConfiguration reporterConfiguration,
                                 Map<String,TestSet> classMethodCounts)
                          throws TestSetFailedException
Throws:
TestSetFailedException
Method Detail

testSetStarting

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

Specified by:
testSetStarting in interface Reporter
Parameters:
description - the report entry describing the testset

testSetCompleted

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

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

testFailed

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

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

testError

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

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

testSkipped

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

testAssumptionFailure

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

testStarting

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

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

checkIfTestSetCanBeReported

public abstract void checkIfTestSetCanBeReported(TestSet testSetForTest)

writeFooter

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

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
Parameters:
message - The message to write.

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

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
Parameters:
report - The report entry to log for
stdOut - standard output from the test case
stdErr - error output from the test case

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
Parameters:
message - The message to write

testError

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

Specified by:
testError in interface Reporter
Parameters:
failure - The report entry to log for
out - standard output from the test case
err - error output from the test case

getTestMethod

protected org.apache.maven.surefire.junitcore.TestMethod getTestMethod()

detachTestMethodFromThread

protected void detachTestMethodFromThread()

getTestSet

protected TestSet getTestSet(ReportEntry description)

getReporterManager

protected Reporter getReporterManager()

createInstance

public static ConcurrentReporterManager createInstance(Map<String,TestSet> classMethodCounts,
                                                       ReporterFactory reporterManagerFactory,
                                                       ReporterConfiguration reporterConfiguration,
                                                       boolean parallelClasses,
                                                       boolean parallelBoth)
                                                throws TestSetFailedException
Throws:
TestSetFailedException


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