UTF-X, Unit Testing Framework - Xslt

utfx.printers
Class AnsiColourResultPrinter

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.PrintStream
              extended by utfx.printers.ResultPrinter
                  extended by utfx.printers.AnsiColourResultPrinter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable, junit.framework.TestListener

public class AnsiColourResultPrinter
extends ResultPrinter

Result printer which generates output that uses the ANSI escape sequences to obtain colours.

Copyright © 2004 - University of Southern Queensland.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

$Source: /cvs/utf-x/framework/src/java/utfx/printers/AnsiColourResultPrinter.java,v $

Version:
$Revision: 1.5 $ $Date: 2006/03/17 23:34:36 $ $Name: release_0_0_8_alpha $
Author:
Jacek Radajewski

Field Summary
(package private)  boolean passed
           
(package private)  boolean reportSuitesOnly
           
(package private)  java.util.Stack statsStack
           
(package private)  int testCount
           
(package private)  int testDepth
           
(package private)  int testNameLength
           
(package private)  java.lang.String testSuiteName
           
(package private)  java.util.Stack testSuiteNames
           
 
Fields inherited from class utfx.printers.ResultPrinter
indentString, log, suiteDepth, testCaseCount
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
AnsiColourResultPrinter(java.io.OutputStream os)
           
 
Method Summary
 void addError(junit.framework.Test test, java.lang.Throwable t)
           
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
           
 void close()
          This method is called after all result printing has been completed.
 void endTestCase(junit.framework.TestCase test)
          End of a test case.
 void endTestSuite(junit.framework.TestSuite suite)
          End of a test suite.
private  java.lang.String getCleanName(junit.framework.Test t)
           
 void printDefect(junit.framework.TestFailure booBoo, int count)
           
 void printDefectHeader(junit.framework.TestFailure booBoo, int count)
           
 void printDefects(java.util.Enumeration booBoos, int count, java.lang.String type)
           
protected  void printDefectTrace(junit.framework.TestFailure booBoo)
           
 void printErrors(junit.framework.TestResult result)
          Print errors.
 void printFailures(junit.framework.TestResult result)
          Print failures.
 void printFooter(junit.framework.TestResult result)
          Print report footer.
 void printHeader(junit.framework.TestResult result)
          Print report header.
 void startTestCase(junit.framework.TestCase test)
          Start of a test case.
 void startTestSuite(junit.framework.TestSuite suite)
          Start of a test suite.
 
Methods inherited from class utfx.printers.ResultPrinter
endTest, getIndent, printElapsedTimeMillis, printIndent, printSummary, setIndentString, start, startTest
 
Methods inherited from class java.io.PrintStream
append, append, append, checkError, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testCount

int testCount

testDepth

int testDepth

testNameLength

int testNameLength

passed

boolean passed

statsStack

java.util.Stack statsStack

testSuiteNames

java.util.Stack testSuiteNames

testSuiteName

java.lang.String testSuiteName

reportSuitesOnly

boolean reportSuitesOnly
Constructor Detail

AnsiColourResultPrinter

public AnsiColourResultPrinter(java.io.OutputStream os)
Method Detail

printHeader

public void printHeader(junit.framework.TestResult result)
Print report header.

Specified by:
printHeader in class ResultPrinter

printErrors

public void printErrors(junit.framework.TestResult result)
Description copied from class: ResultPrinter
Print errors. Based on junit.textui.ResultPrinter

Specified by:
printErrors in class ResultPrinter
Parameters:
result - test result

printFailures

public void printFailures(junit.framework.TestResult result)
Description copied from class: ResultPrinter
Print failures. Based on junit.textui.ResultPrinter

Specified by:
printFailures in class ResultPrinter
Parameters:
result - test result

printDefects

public void printDefects(java.util.Enumeration booBoos,
                         int count,
                         java.lang.String type)

printDefect

public void printDefect(junit.framework.TestFailure booBoo,
                        int count)

printDefectHeader

public void printDefectHeader(junit.framework.TestFailure booBoo,
                              int count)

printDefectTrace

protected void printDefectTrace(junit.framework.TestFailure booBoo)

printFooter

public void printFooter(junit.framework.TestResult result)
Print report footer.

Specified by:
printFooter in class ResultPrinter

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable t)
See Also:
TestListener.addError(Test, Throwable)

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
See Also:
TestListener.addFailure(Test, AssertionFailedError)

close

public void close()
This method is called after all result printing has been completed. It flushes and closes the PrintStream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.PrintStream

startTestCase

public void startTestCase(junit.framework.TestCase test)
Description copied from class: ResultPrinter
Start of a test case.

Specified by:
startTestCase in class ResultPrinter
Parameters:
test - the TestSuite we are entering.
See Also:
TestListener.startTest(Test)

getCleanName

private java.lang.String getCleanName(junit.framework.Test t)

endTestCase

public void endTestCase(junit.framework.TestCase test)
Description copied from class: ResultPrinter
End of a test case.

Specified by:
endTestCase in class ResultPrinter
See Also:
TestListener.endTest(Test)

startTestSuite

public void startTestSuite(junit.framework.TestSuite suite)
Start of a test suite.

Specified by:
startTestSuite in class ResultPrinter
Parameters:
suite - the TestSuite we are entering.

endTestSuite

public void endTestSuite(junit.framework.TestSuite suite)
End of a test suite.

Specified by:
endTestSuite in class ResultPrinter
Parameters:
suite - the test suite we are leaving

UTF-X, Unit Testing Framework - Xslt