org.apache.tools.ant.taskdefs.optional.junit
public class JUnitTest extends BaseTest implements Cloneable
Run a single JUnit test.
The JUnit test is actually run by JUnitTestRunner. So read the doc comments for that class :)
Since: Ant 1.2
See Also: JUnitTask JUnitTestRunner
| Constructor Summary | |
|---|---|
| JUnitTest() No arg constructor. | |
| JUnitTest(String name)
Constructor with name. | |
| JUnitTest(String name, boolean haltOnError, boolean haltOnFailure, boolean filtertrace)
Constructor with options. | |
| Method Summary | |
|---|---|
| Object | clone() |
| long | errorCount()
Get the number of errors. |
| long | failureCount()
Get the number of failures. |
| FormatterElement[] | getFormatters()
Get the formatters set for this test. |
| String | getName()
Get the name of the test class. |
| String | getOutfile()
Get the name of the output file
|
| Properties | getProperties()
Get the properties used in the test. |
| long | getRunTime()
Get the run time. |
| long | runCount()
Get the number of runs. |
| void | setCounts(long runs, long failures, long errors)
Set the number of runs, failures and errors. |
| void | setName(String value)
Set the name of the test class. |
| void | setOutfile(String value)
Set the name of the output file. |
| void | setProperties(Hashtable p)
Set the properties to be used in the test. |
| void | setRunTime(long runTime)
Set the runtime. |
| boolean | shouldRun(Project p)
Check if this test should run based on the if and unless
attributes. |
Parameters: name the name of the test.
Parameters: name the name of the test. haltOnError if true halt the tests if there is an error. haltOnFailure if true halt the tests if there is a failure. filtertrace if true filter stack traces.
Returns: a clone of this test.
Since: Ant 1.5
Returns: the number of errors.
Returns: the number of failures.
Returns: the formatters as an array.
Returns: the name of the test.
Returns: the name of the output file.
Returns: the properties.
Returns: the run time in milliseconds.
Returns: the number of runs.
Parameters: runs the number of runs. failures the number of failures. errors the number of errors.
Parameters: value the name to use.
Parameters: value the name of the output file to use.
Parameters: p the properties. This is a copy of the projects ant properties.
Parameters: runTime the time in milliseconds.
Parameters: p the project to use to check if the if and unless properties exist in.
Returns: true if this test or testsuite should be run.