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 :)
JUnitTask,
JUnitTestRunnerdestDir, errorProperty, failureProperty, filtertrace, fork, formatters, haltOnError, haltOnFail, ifProperty, unlessProperty| Constructor and Description |
|---|
JUnitTest()
No arg constructor.
|
JUnitTest(String name)
Constructor with name.
|
JUnitTest(String name,
boolean haltOnError,
boolean haltOnFailure,
boolean filtertrace)
Constructor with options.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
String |
getWebClasspath() |
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.
|
void |
setWebClasspaths(String webClasspath) |
boolean |
shouldRun(Project p)
Check if this test should run based on the if and unless attributes.
|
String |
toString() |
addFormatter, getErrorProperty, getFailureProperty, getFiltertrace, getFork, getHaltonerror, getHaltonfailure, getTodir, setErrorProperty, setFailureProperty, setFiltertrace, setFork, setHaltonerror, setHaltonfailure, setIf, setTodir, setUnlesspublic JUnitTest()
public JUnitTest(String name)
name - the name of the test.public JUnitTest(String name, boolean haltOnError, boolean haltOnFailure, boolean filtertrace)
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.public String getWebClasspath()
public void setWebClasspaths(String webClasspath)
public void setName(String value)
value - the name to use.public void setOutfile(String value)
value - the name of the output file to use.public String getName()
public String getOutfile()
public void setCounts(long runs,
long failures,
long errors)
runs - the number of runs.failures - the number of failures.errors - the number of errors.public void setRunTime(long runTime)
runTime - the time in milliseconds.public long runCount()
public long failureCount()
public long errorCount()
public long getRunTime()
public Properties getProperties()
public void setProperties(Hashtable p)
p - the properties. This is a copy of the projects ant properties.public boolean shouldRun(Project p)
p - the project to use to check if the if and unless properties exist in.public FormatterElement[] getFormatters()
public Object clone()
Copyright © 2017 SAP SE. All Rights Reserved.