org.apache.maven.surefire.report
Class TestConsoleOutputRunListener

java.lang.Object
  extended by org.apache.maven.surefire.report.TestConsoleOutputRunListener
All Implemented Interfaces:
ConsoleOutputReceiver, RunListener
Direct Known Subclasses:
TestConsoleOutputRunListener.OneThreadPerClassConsoleOutputRunListener, TestConsoleOutputRunListener.UnknownThreadPerClassConsoleOutputRunListener

public abstract class TestConsoleOutputRunListener
extends Object
implements RunListener, ConsoleOutputReceiver

Attaches the currently executing test method to the thread, allowing test output to be directed to the proper test set.

Author:
Kristian Rosenvold

Nested Class Summary
static class TestConsoleOutputRunListener.OneThreadPerClassConsoleOutputRunListener
           
static class TestConsoleOutputRunListener.UnknownThreadPerClassConsoleOutputRunListener
           
 
Constructor Summary
protected TestConsoleOutputRunListener(ReporterFactory reporterFactory)
           
 
Method Summary
protected abstract  void clearTestMethodRunListener(ReportEntry reportEntry)
           
protected abstract  void clearTestSetRunListener(ReportEntry reportEntry)
           
static TestConsoleOutputRunListener createInstance(ReporterFactory reporterFactory, boolean oneThreadPerClass)
           
protected abstract  ConsoleOutputReceiver getConsoleOutputReceiver()
           
protected  ReporterFactory getReporterFactory()
           
protected abstract  RunListener getTestMethodRunListener(ReportEntry report)
           
protected abstract  RunListener getTestSetRunListener(ReportEntry reportEntry)
           
 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 testFailed(ReportEntry report)
          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 writeTestOutput(byte[] buf, int off, int len, boolean stdout)
          Forwards process output from the running test-case into the reporting system
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestConsoleOutputRunListener

protected TestConsoleOutputRunListener(ReporterFactory reporterFactory)
Method Detail

createInstance

public static TestConsoleOutputRunListener createInstance(ReporterFactory reporterFactory,
                                                          boolean oneThreadPerClass)

getTestSetRunListener

protected abstract RunListener getTestSetRunListener(ReportEntry reportEntry)

clearTestSetRunListener

protected abstract void clearTestSetRunListener(ReportEntry reportEntry)

getTestMethodRunListener

protected abstract RunListener getTestMethodRunListener(ReportEntry report)

clearTestMethodRunListener

protected abstract void clearTestMethodRunListener(ReportEntry reportEntry)

getConsoleOutputReceiver

protected abstract ConsoleOutputReceiver getConsoleOutputReceiver()

getReporterFactory

protected ReporterFactory getReporterFactory()

writeTestOutput

public void writeTestOutput(byte[] buf,
                            int off,
                            int len,
                            boolean stdout)
Description copied from interface: ConsoleOutputReceiver
Forwards process output from the running test-case into the reporting system

Specified by:
writeTestOutput in interface ConsoleOutputReceiver
Parameters:
buf - the buffer to write
off - offset
len - len
stdout - Indicates if this is stdout

testSetStarting

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

Specified by:
testSetStarting in interface RunListener
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: RunListener
Indicates end of a given test-set

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

testStarting

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

Specified by:
testStarting in interface RunListener
Parameters:
report - The report entry to log for

testSucceeded

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

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

testAssumptionFailure

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

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

testError

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

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

testFailed

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

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

testSkipped

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


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