ise.antelope.tasks
public class Assert extends org.apache.tools.ant.Task implements org.apache.tools.ant.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.
Constructor and Description |
---|
Assert() |
Modifier and Type | Method and Description |
---|---|
void |
addBool(BooleanConditionTask boolTask)
Adds a feature to the Bool attribute of the Assert object
|
void |
addTask(org.apache.tools.ant.Task task)
Add a nested task to execute.
|
void |
execute()
Execute this task and all nested Tasks.
|
static void |
main(java.lang.String[] args)
The main program for the Assert class
|
void |
maybeConfigure()
Override
maybeConfigure
in a way that leaves the nested tasks unconfigured until they get
executed. |
static int |
runTests()
Description of the Method
|
void |
setExecute(java.lang.String execute)
Ant boolean, if true, execute any contained tasks.
|
void |
setExists(java.lang.String exists)
Set the 'exists' attribute.
|
void |
setFailonerror(boolean fail)
Ant boolean, stop the build process if the assertion fails.
|
void |
setLevel(AssertLevel assertlevel)
Sets the assertion level.
|
void |
setMessage(java.lang.String msg)
Set a specific message to include in the output in the event this assert
fails.
|
void |
setName(java.lang.String name)
Set the name of the property to test.
|
void |
setValue(java.lang.String value)
Set the expected value of the property.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void setName(java.lang.String name)
name
- the name of the property to test.public void setValue(java.lang.String value)
value
- the expected value of the property.public void setMessage(java.lang.String msg)
msg
- the message to includepublic void setExists(java.lang.String exists)
exists
- Ant boolean, whether the value must exist.public void setExecute(java.lang.String execute)
execute
- Ant boolean, whether to execute contained tasks.public void setFailonerror(boolean fail)
fail
- Ant boolean, whether to stop the build on assertion error.public void setLevel(AssertLevel assertlevel)
assertlevel
- one of "error", "warning", "info", or "debug" levels.public void maybeConfigure() throws org.apache.tools.ant.BuildException
maybeConfigure
in a way that leaves the nested tasks unconfigured until they get
executed.maybeConfigure
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- Description of Exceptionpublic void addTask(org.apache.tools.ant.Task task)
addTask
in interface org.apache.tools.ant.TaskContainer
task
- Nested task to execute. public void addBool(BooleanConditionTask boolTask)
boolTask
- The feature to be added to the Bool attributepublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- Description of Exceptionpublic static int runTests()
public static void main(java.lang.String[] args)
args
- The command line arguments