|
JUnitTestRunner (Apache Ant API)
org.apache.tools.ant.taskdefs.optional.junit
|
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 filtertrace,
boolean haltOnFailure)
Constructor for fork=true or when the user hasn't specified a classpath. |
|
JUnitTestRunner(JUnitTest test,
boolean haltOnError,
boolean filtertrace,
boolean haltOnFailure,
boolean showOutput)
Constructor for fork=true or when the user hasn't specified a classpath. |
|
JUnitTestRunner(JUnitTest test,
boolean haltOnError,
boolean filtertrace,
boolean haltOnFailure,
boolean showOutput,
java.lang.ClassLoader loader)
Constructor to use when the user has specified a classpath. |
|
JUnitTestRunner(JUnitTest test,
boolean haltOnError,
boolean filtertrace,
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. |
static java.lang.String |
filterStack(java.lang.String stack)
Filters stack frames from internal JUnit and Ant classes |
static java.lang.String |
getFilteredTrace(java.lang.Throwable t)
Returns a filtered stack trace. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 filtertrace, boolean haltOnFailure)
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput)
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, java.lang.ClassLoader loader)
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, java.lang.ClassLoader loader)
Method Detail |
public void run()
public int getRetCode()
public void startTest(junit.framework.Test t)
A new Test is started.
startTest
in interface junit.framework.TestListener
public void endTest(junit.framework.Test test)
A Test is finished.
endTest
in interface junit.framework.TestListener
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.
addFailure
in interface junit.framework.TestListener
public void addError(junit.framework.Test test, java.lang.Throwable t)
An error occured while running the test.
addError
in interface junit.framework.TestListener
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 |
showoutput | send output to System.err/.out as well as to the formatters? | false |
java.io.IOException
public static java.lang.String getFilteredTrace(java.lang.Throwable t)
public static java.lang.String filterStack(java.lang.String stack)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |