com.carrotsearch.ant.tasks.junit4.listeners
Class TextReport

java.lang.Object
  extended by com.carrotsearch.ant.tasks.junit4.listeners.TextReport
All Implemented Interfaces:
AggregatedEventListener

public class TextReport
extends Object
implements AggregatedEventListener

A listener that will subscribe to test execution and dump informational info about the progress to the console or a text file.


Nested Class Summary
static class TextReport.OutputMode
          Display mode for output streams.
 
Constructor Summary
TextReport()
           
 
Method Summary
 void onHeartbeat(HeartBeatEvent e)
           
 void onOutput(PartialOutputEvent e)
           
 void onQuit(AggregatedQuitEvent e)
           
 void onStart(AggregatedStartEvent e)
           
 void onSuiteResult(AggregatedSuiteResultEvent e)
           
 void onSuiteStart(AggregatedSuiteStartedEvent e)
           
 void onTestResult(AggregatedTestResultEvent e)
           
 void setAppend(boolean append)
          Append if setFile(File) is also specified.
 void setFile(File outputFile)
          Set an external file to write to.
 void setMaxClassNameColumns(int maxClassNameColumns)
          Set maximum number of class name columns before truncated with ellipsis.
 void setOuter(JUnit4 task)
          Initialization by container task JUnit4.
 void setShowNumFailures(int num)
          Summarize N failures at the end of the report.
 void setShowOutput(String mode)
          Display mode for output streams.
 void setShowStackTraces(boolean showStackTraces)
          Show stack trace information.
 void setShowStatusError(boolean showStatus)
           
 void setShowStatusFailure(boolean showStatus)
           
 void setShowStatusIgnored(boolean showStatus)
           
 void setShowStatusOk(boolean showStatus)
           
 void setShowSuiteSummary(boolean showSuiteSummary)
          If enabled, shows suite summaries in "maven-like" format of:
 void setShowThrowable(boolean showThrowable)
          If enabled, displays extended error information for tests that failed (exception class, message, stack trace, standard streams).
 void setTimestamps(boolean timestamps)
          Show duration timestamps for tests and suites.
 void setUseSimpleNames(boolean useSimpleNames)
          Use simple class names for suite naming.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextReport

public TextReport()
Method Detail

setShowStatusError

public void setShowStatusError(boolean showStatus)

setShowStatusFailure

public void setShowStatusFailure(boolean showStatus)

setShowStatusOk

public void setShowStatusOk(boolean showStatus)

setShowStatusIgnored

public void setShowStatusIgnored(boolean showStatus)

setMaxClassNameColumns

public void setMaxClassNameColumns(int maxClassNameColumns)
Set maximum number of class name columns before truncated with ellipsis.


setUseSimpleNames

public void setUseSimpleNames(boolean useSimpleNames)
Use simple class names for suite naming.


setTimestamps

public void setTimestamps(boolean timestamps)
Show duration timestamps for tests and suites.


setShowThrowable

public void setShowThrowable(boolean showThrowable)
If enabled, displays extended error information for tests that failed (exception class, message, stack trace, standard streams).

See Also:
setShowStackTraces(boolean)

setShowStackTraces

public void setShowStackTraces(boolean showStackTraces)
Show stack trace information.


setShowOutput

public void setShowOutput(String mode)
Display mode for output streams.


setShowNumFailures

public void setShowNumFailures(int num)
Summarize N failures at the end of the report.


setShowSuiteSummary

public void setShowSuiteSummary(boolean showSuiteSummary)
If enabled, shows suite summaries in "maven-like" format of:
 Running SuiteName
 [...suite tests if enabled...]
 Tests: xx, Failures: xx, Errors: xx, Skipped: xx, Time: xx sec [<<< FAILURES!]
 


setFile

public void setFile(File outputFile)
             throws IOException
Set an external file to write to. That file will always be in UTF-8.

Throws:
IOException

setAppend

public void setAppend(boolean append)
Append if setFile(File) is also specified.


setOuter

public void setOuter(JUnit4 task)
Initialization by container task JUnit4.

Specified by:
setOuter in interface AggregatedEventListener

onStart

public void onStart(AggregatedStartEvent e)
             throws IOException
Throws:
IOException

onHeartbeat

public void onHeartbeat(HeartBeatEvent e)
                 throws IOException
Throws:
IOException

onQuit

public void onQuit(AggregatedQuitEvent e)
            throws IOException
Throws:
IOException

onSuiteStart

public void onSuiteStart(AggregatedSuiteStartedEvent e)
                  throws IOException
Throws:
IOException

onOutput

public void onOutput(PartialOutputEvent e)
              throws IOException
Throws:
IOException

onTestResult

public void onTestResult(AggregatedTestResultEvent e)
                  throws IOException
Throws:
IOException

onSuiteResult

public void onSuiteResult(AggregatedSuiteResultEvent e)
                   throws IOException
Throws:
IOException


Copyright © 2011-2012 Carrot Search s.c.. All Rights Reserved.