net.sf.antcontrib.logic
public class Assert extends Task implements TaskContainer
Also like Java's 'assert' keyword, the Assert task must be 'turned on' using the property "ant.enable.asserts". If not set, or is set to false, the Assert task works exactly like the Sequential task.
Can hold other tasks including Assert. Attributes:
The assert task supports a single nested BooleanCondition task, otherwise, the assert task does not support any nested elements apart from Ant tasks. Any valid Ant task may be embedded within the assert task.
Developed for use with Antelope, migrated to ant-contrib Oct 2003.
Since: Ant 1.5
Version: $Revision: 1.3 $
Method Summary | |
---|---|
void | addBool(BooleanConditionTask boolTask) |
void | addTask(Task task)
Add a nested task to execute.
|
void | execute()
Execute this task and all nested Tasks. |
static void | main(String[] args) |
void | maybeConfigure()
Override org.apache.tools.ant.Task#maybeConfigure
maybeConfigure in a way that leaves the nested tasks
unconfigured until they get executed.
|
static int | runTests() |
void | setExecute(String execute)
Ant boolean, if true, execute any contained tasks. |
void | setExists(String exists)
Set the 'exists' attribute. |
void | setFailonerror(String fail)
Ant boolean, stop the build process if the assertion fails. |
void | setMessage(String msg) |
void | setName(String name)
Set the name of the property to test. |
void | setValue(String value)
Set the expected value of the property. |
Parameters: task Nested task to execute.
org.apache.tools.ant.Task#maybeConfigure
maybeConfigure
in a way that leaves the nested tasks
unconfigured until they get executed.
Since: Ant 1.5
Parameters: execute Ant boolean, whether to execute contained tasks.
Parameters: exists Ant boolean, whether the value must exist.
Parameters: fail Ant boolean, whether to stop the build on assertion error.
Parameters: name the name of the property to test.
Parameters: value the expected value of the property.