org.apache.tools.ant.taskdefs.optional.junit

Class BaseTest

public abstract class BaseTest extends Object

Baseclass for BatchTest and JUnitTest.
Field Summary
protected FiledestDir
destination directory
protected StringerrorProperty
protected StringfailureProperty
protected booleanfiltertrace
protected booleanfork
protected Vectorformatters
protected booleanhaltOnError
protected booleanhaltOnFail
protected StringifProperty
protected StringunlessProperty
Method Summary
voidaddFormatter(FormatterElement elem)
Allow a formatter nested element.
StringgetErrorProperty()
Get the failure property name.
StringgetFailureProperty()
Get the failure property name.
booleangetFiltertrace()
Get the filtertrace attribute.
booleangetFork()
Get the fork attribute.
booleangetHaltonerror()
Get the haltonerror attribute.
booleangetHaltonfailure()
Get the haltonfailure attribute.
ObjectgetIfCondition()
The if expression
StringgetTodir()
Get the destination directory.
ObjectgetUnlessCondition()
The unless expression
voidsetErrorProperty(String errorProperty)
Set the name of the error property.
voidsetFailureProperty(String failureProperty)
Set the name of the failure property.
voidsetFiltertrace(boolean value)
Set the filtertrace attribute.
voidsetFork(boolean value)
Set the fork attribute.
voidsetHaltonerror(boolean value)
Set the haltonerror attribute.
voidsetHaltonfailure(boolean value)
Set the haltonfailure attribute.
voidsetIf(Object ifCondition)
Set the if attribute.
voidsetIf(String propertyName)
Set the if attribute.
voidsetTodir(File destDir)
Sets the destination directory.
voidsetUnless(Object unlessCondition)
Set the unless attribute.
voidsetUnless(String propertyName)
Set the unless attribute.

Field Detail

destDir

protected File destDir
destination directory

errorProperty

protected String errorProperty

failureProperty

protected String failureProperty

filtertrace

protected boolean filtertrace

fork

protected boolean fork

formatters

protected Vector formatters

haltOnError

protected boolean haltOnError

haltOnFail

protected boolean haltOnFail

ifProperty

protected String ifProperty

unlessProperty

protected String unlessProperty

Method Detail

addFormatter

public void addFormatter(FormatterElement elem)
Allow a formatter nested element.

Parameters: elem a formatter nested element.

getErrorProperty

public String getErrorProperty()
Get the failure property name.

Returns: the name of the property to set on failure.

getFailureProperty

public String getFailureProperty()
Get the failure property name.

Returns: the name of the property to set on failure.

getFiltertrace

public boolean getFiltertrace()
Get the filtertrace attribute.

Returns: the attribute.

getFork

public boolean getFork()
Get the fork attribute.

Returns: the attribute.

getHaltonerror

public boolean getHaltonerror()
Get the haltonerror attribute.

Returns: the attribute.

getHaltonfailure

public boolean getHaltonfailure()
Get the haltonfailure attribute.

Returns: the attribute.

getIfCondition

public Object getIfCondition()
The if expression

Since: Ant 1.8.0

getTodir

public String getTodir()
Get the destination directory.

Returns: the destination directory as an absolute path if it exists otherwise return null

getUnlessCondition

public Object getUnlessCondition()
The unless expression

Since: Ant 1.8.0

setErrorProperty

public void setErrorProperty(String errorProperty)
Set the name of the error property.

Parameters: errorProperty the name of the property to set if the test has an error.

setFailureProperty

public void setFailureProperty(String failureProperty)
Set the name of the failure property.

Parameters: failureProperty the name of the property to set if the test fails.

setFiltertrace

public void setFiltertrace(boolean value)
Set the filtertrace attribute.

Parameters: value a boolean value.

setFork

public void setFork(boolean value)
Set the fork attribute.

Parameters: value a boolean value.

setHaltonerror

public void setHaltonerror(boolean value)
Set the haltonerror attribute.

Parameters: value a boolean value.

setHaltonfailure

public void setHaltonfailure(boolean value)
Set the haltonfailure attribute.

Parameters: value a boolean value.

setIf

public void setIf(Object ifCondition)
Set the if attribute. If this expression evaluates to true or the name of a property which is present in project, the test will be run.

Parameters: ifCondition the expression to evaluate

Since: Ant 1.8.0

setIf

public void setIf(String propertyName)
Set the if attribute. If this expression evaluates to true or the name of a property which is present in project, the test will be run.

Parameters: propertyName the expression to evaluate

setTodir

public void setTodir(File destDir)
Sets the destination directory.

Parameters: destDir the destination directory.

setUnless

public void setUnless(Object unlessCondition)
Set the unless attribute. If this expression evaluates to false or the name of a property which is not present in project, the test will be run.

Parameters: unlessCondition the expression to evaluate

Since: Ant 1.8.0

setUnless

public void setUnless(String propertyName)
Set the unless attribute. If this expression evaluates to false or the name of a property which is not present in project, the test will be run.

Parameters: propertyName the expression to evaluate