net.groboclown.junit.v1
Class XmlTestRunner

java.lang.Object
  |
  +--net.groboclown.junit.v1.XmlTestRunner
All Implemented Interfaces:
junit.framework.TestListener

public class XmlTestRunner
extends Object
implements junit.framework.TestListener

A variation on Kent Beck's TestRunner implementations.

See Also:
junit.textui.TestRunner, junit.swingui.TestRunner

Field Summary
(package private)  PrintStream fWriter
           
 
Constructor Summary
XmlTestRunner()
           
XmlTestRunner(PrintStream writer)
           
 
Method Summary
 void addError(junit.framework.Test test, Throwable t)
           
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
           
protected  junit.framework.TestResult createTestResult()
           
protected  boolean doRun(junit.framework.Test suite)
          Stdout and stderr are not trapped.
 void endTest(junit.framework.Test test1)
           
private  String extractClassName(String className)
           
protected  void help()
          Display the proper syntax for calling this class.
static void main(String[] args)
          Called from the command line.
 void printFooter(junit.framework.Test suite)
           
 void printHeader(junit.framework.Test suite)
           
 void printSummary(junit.framework.TestResult result, long runTime)
           
static void run(Class testClass)
           
static void run(junit.framework.Test suite)
           
static void run(junit.framework.Test suite, PrintStream writer)
           
protected  boolean start(String[] args)
           
 void startTest(junit.framework.Test test)
           
private  PrintStream writer()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fWriter

PrintStream fWriter
Constructor Detail

XmlTestRunner

public XmlTestRunner()

XmlTestRunner

public XmlTestRunner(PrintStream writer)
Method Detail

main

public static void main(String[] args)
Called from the command line.
Parameters:
args - the command line arguments

run

public static void run(Class testClass)

run

public static void run(junit.framework.Test suite)

run

public static void run(junit.framework.Test suite,
                       PrintStream writer)

startTest

public void startTest(junit.framework.Test test)
Specified by:
startTest in interface junit.framework.TestListener

addError

public void addError(junit.framework.Test test,
                     Throwable t)
Specified by:
addError in interface junit.framework.TestListener

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
Specified by:
addFailure in interface junit.framework.TestListener

endTest

public void endTest(junit.framework.Test test1)
Specified by:
endTest in interface junit.framework.TestListener

doRun

protected boolean doRun(junit.framework.Test suite)
Stdout and stderr are not trapped.
Returns:
true if the suite ran successfully, or false if it failed.

printHeader

public void printHeader(junit.framework.Test suite)

printSummary

public void printSummary(junit.framework.TestResult result,
                         long runTime)

printFooter

public void printFooter(junit.framework.Test suite)

start

protected boolean start(String[] args)

createTestResult

protected junit.framework.TestResult createTestResult()

help

protected void help()
Display the proper syntax for calling this class.

writer

private PrintStream writer()

extractClassName

private String extractClassName(String className)


Written under the LGPL