org.apache.tools.ant.taskdefs.optional.junit
Class JUnitTest
- Cloneable
public class JUnitTest
implements Cloneable
Run a single JUnit test.
The JUnit test is actually run by
JUnitTestRunner
.
So read the doc comments for that class :)
JUnitTest() - No arg constructor.
|
JUnitTest(String name) - Constructor with name.
|
JUnitTest(String name, boolean haltOnError, boolean haltOnFailure, boolean filtertrace) - Constructor with options.
|
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.
|
addFormatter , getErrorProperty , getFailureProperty , getFiltertrace , getFork , getHaltonerror , getHaltonfailure , getTodir , setErrorProperty , setFailureProperty , setFiltertrace , setFork , setHaltonerror , setHaltonfailure , setIf , setTodir , setUnless |
JUnitTest
public JUnitTest()
No arg constructor.
JUnitTest
public JUnitTest(String name)
Constructor with name.
name
- the name of the test.
JUnitTest
public JUnitTest(String name,
boolean haltOnError,
boolean haltOnFailure,
boolean filtertrace)
Constructor with options.
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.
clone
public Object clone()
errorCount
public long errorCount()
Get the number of errors.
failureCount
public long failureCount()
Get the number of failures.
getFormatters
public FormatterElement[] getFormatters()
Get the formatters set for this test.
- the formatters as an array.
getName
public String getName()
Get the name of the test class.
getOutfile
public String getOutfile()
Get the name of the output file
- the name of the output file.
getProperties
public Properties getProperties()
Get the properties used in the test.
getRunTime
public long getRunTime()
Get the run time.
- the run time in milliseconds.
runCount
public long runCount()
Get the number of runs.
setCounts
public void setCounts(long runs,
long failures,
long errors)
Set the number of runs, failures and errors.
runs
- the number of runs.failures
- the number of failures.errors
- the number of errors.
setName
public void setName(String value)
Set the name of the test class.
setOutfile
public void setOutfile(String value)
Set the name of the output file.
value
- the name of the output file to use.
setProperties
public void setProperties(Hashtable p)
Set the properties to be used in the test.
p
- the properties.
This is a copy of the projects ant properties.
setRunTime
public void setRunTime(long runTime)
Set the runtime.
runTime
- the time in milliseconds.
shouldRun
public boolean shouldRun(Project p)
Check if this test should run based on the if and unless
attributes.
p
- the project to use to check if the if and unless
properties exist in.
- true if this test or testsuite should be run.