org.apache.felix.ipojo.junit4osgi.impl
Class ResultPrinter

java.lang.Object
  extended by org.apache.felix.ipojo.junit4osgi.impl.ResultPrinter
All Implemented Interfaces:
junit.framework.TestListener

public class ResultPrinter
extends Object
implements junit.framework.TestListener

Result Printer.

Author:
Felix Project Team

Constructor Summary
ResultPrinter(PrintStream writer)
          Creates a ResultPrinter.
 
Method Summary
 void addError(junit.framework.Test test, Throwable t)
          Adds an error.
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
          Adds a failure.
protected  String elapsedTimeAsString(long runTime)
          Returns the formatted string of the elapsed time.
 void endTest(junit.framework.Test test)
          A test ends.
 PrintStream getWriter()
           
 void printDefect(junit.framework.TestFailure booBoo, int count)
          Prints a failure.
protected  void printDefectHeader(junit.framework.TestFailure booBoo, int count)
          Prints defect header.
protected  void printDefects(Enumeration booBoos, int count, String type)
          Prints failures.
protected  void printDefectTrace(junit.framework.TestFailure booBoo)
          Prints the stack trace.
protected  void printErrors(junit.framework.TestResult result)
          Prints the errors.
protected  void printFailures(junit.framework.TestResult result)
          Prints failures.
protected  void printFooter(junit.framework.TestResult result)
          Prints the footer.
protected  void printHeader(long runTime)
          Prints the result header.
 void startTest(junit.framework.Test test)
          A test starts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultPrinter

public ResultPrinter(PrintStream writer)
Creates a ResultPrinter.

Parameters:
writer - the printer
Method Detail

printHeader

protected void printHeader(long runTime)
Prints the result header.

Parameters:
runTime - the test execution duration

printErrors

protected void printErrors(junit.framework.TestResult result)
Prints the errors.

Parameters:
result - the test result

printFailures

protected void printFailures(junit.framework.TestResult result)
Prints failures.

Parameters:
result - the test result

printDefects

protected void printDefects(Enumeration booBoos,
                            int count,
                            String type)
Prints failures.

Parameters:
booBoos - the failures
count - the number of failures
type - the type

printDefect

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

Parameters:
booBoo - the failure
count - the count

printDefectHeader

protected void printDefectHeader(junit.framework.TestFailure booBoo,
                                 int count)
Prints defect header.

Parameters:
booBoo - the failure
count - the count

printDefectTrace

protected void printDefectTrace(junit.framework.TestFailure booBoo)
Prints the stack trace.

Parameters:
booBoo - the failure

printFooter

protected void printFooter(junit.framework.TestResult result)
Prints the footer.

Parameters:
result - the test result.

elapsedTimeAsString

protected String elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.

Parameters:
runTime - the elapsed time
Returns:
the elapsed time.

getWriter

public PrintStream getWriter()

addError

public void addError(junit.framework.Test test,
                     Throwable t)
Adds an error.

Specified by:
addError in interface junit.framework.TestListener
Parameters:
test - the test in error.
t - the thrown error
See Also:
TestListener.addError(Test, Throwable)

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
Adds a failure.

Specified by:
addFailure in interface junit.framework.TestListener
Parameters:
test - the failing test.
t - the thrown failure
See Also:
TestListener.addFailure(Test, AssertionFailedError)

endTest

public void endTest(junit.framework.Test test)
A test ends. (do nothing)

Specified by:
endTest in interface junit.framework.TestListener
Parameters:
test - the ending test
See Also:
TestListener.endTest(Test)

startTest

public void startTest(junit.framework.Test test)
A test starts.

Specified by:
startTest in interface junit.framework.TestListener
Parameters:
test - the starting test
See Also:
TestListener.startTest(Test)


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.