|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner
Simple Testrunner for JUnit that runs all tests of a testsuite.
This TestRunner expects a name of a TestCase class as its argument. If this class provides a static suite() method it will be called and the resulting Test will be run. So, the signature should be
public static junit.framework.Test suite()
If no such method exists, all public methods starting with "test" and taking no argument will be run.
Summary output is generated at the end.
Field Summary | |
static int |
ERRORS
An error occured. |
static int |
FAILURES
Some tests failed. |
static int |
SUCCESS
No problems with this test. |
Constructor Summary | |
JUnitTestRunner(JUnitTest test,
boolean haltOnError,
boolean haltOnFailure)
Constructor for fork=true or when the user hasn't specified a classpath. |
|
JUnitTestRunner(JUnitTest test,
boolean haltOnError,
boolean haltOnFailure,
java.lang.ClassLoader loader)
Constructor to use when the user has specified a classpath. |
Method Summary | |
void |
addError(junit.framework.Test test,
java.lang.Throwable t)
Interface TestListener. |
void |
addFailure(junit.framework.Test test,
junit.framework.AssertionFailedError t)
Interface TestListener for JUnit > 3.4. |
void |
addFailure(junit.framework.Test test,
java.lang.Throwable t)
Interface TestListener for JUnit <= 3.4. |
void |
addFormatter(JUnitResultFormatter f)
|
void |
endTest(junit.framework.Test test)
Interface TestListener. |
int |
getRetCode()
Returns what System.exit() would return in the standalone version. |
protected void |
handleErrorOutput(java.lang.String line)
|
protected void |
handleOutput(java.lang.String line)
|
static void |
main(java.lang.String[] args)
Entry point for standalone (forked) mode. |
void |
run()
|
void |
startTest(junit.framework.Test t)
Interface TestListener. |
Field Detail |
public static final int SUCCESS
public static final int FAILURES
public static final int ERRORS
Constructor Detail |
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean haltOnFailure)
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean haltOnFailure, java.lang.ClassLoader loader)
Method Detail |
public void run()
public int getRetCode()
public void startTest(junit.framework.Test t)
A new Test is started.
public void endTest(junit.framework.Test test)
A Test is finished.
public void addFailure(junit.framework.Test test, java.lang.Throwable t)
A Test failed.
public void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
A Test failed.
public void addError(junit.framework.Test test, java.lang.Throwable t)
An error occured while running the test.
protected void handleOutput(java.lang.String line)
protected void handleErrorOutput(java.lang.String line)
public void addFormatter(JUnitResultFormatter f)
public static void main(java.lang.String[] args) throws java.io.IOException
key | description | default value |
---|---|---|
haltOnError | halt test on errors? | false |
haltOnFailure | halt test on failures? | false |
formatter | A JUnitResultFormatter given as classname,filename. If filename is ommitted, System.out is assumed. | none |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |