| Method from org.apache.tools.ant.taskdefs.optional.junit.JUnitTest Detail: |
void addFormattersTo(Vector v) {
final int count = formatters.size();
for (int i = 0; i < count; i++) {
v.addElement(formatters.elementAt(i));
}
}
Convenient method to add formatters to a vector |
public Object clone() {
try {
JUnitTest t = (JUnitTest) super.clone();
t.props = props == null ? null : (Properties) props.clone();
t.formatters = (Vector) formatters.clone();
return t;
} catch (CloneNotSupportedException e) {
// plain impossible
return this;
}
}
|
public long errorCount() {
return errors;
}
Get the number of errors. |
public long failureCount() {
return failures;
}
Get the number of failures. |
public FormatterElement[] getFormatters() {
FormatterElement[] fes = new FormatterElement[formatters.size()];
formatters.copyInto(fes);
return fes;
}
Get the formatters set for this test. |
public String getName() {
return name;
}
Get the name of the test class. |
public String getOutfile() {
return outfile;
}
Get the name of the output file |
public Properties getProperties() {
return props;
}
Get the properties used in the test. |
public long getRunTime() {
return runTime;
}
|
public long runCount() {
return runs;
}
|
public void setCounts(long runs,
long failures,
long errors) {
this.runs = runs;
this.failures = failures;
this.errors = errors;
}
Set the number of runs, failures and errors. |
public void setName(String value) {
name = value;
}
Set the name of the test class. |
public void setOutfile(String value) {
outfile = value;
}
Set the name of the output file. |
public void setProperties(Hashtable p) {
props = new Properties();
for (Enumeration e = p.keys(); e.hasMoreElements();) {
Object key = e.nextElement();
props.put(key, p.get(key));
}
}
Set the properties to be used in the test. |
public void setRunTime(long runTime) {
this.runTime = runTime;
}
|
public boolean shouldRun(Project p) {
if (ifProperty != null && p.getProperty(ifProperty) == null) {
return false;
} else if (unlessProperty != null
&& p.getProperty(unlessProperty) != null) {
return false;
}
return true;
}
Check if this test should run based on the if and unless
attributes. |