|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
org.apache.ant.antunit.AssertTask
public class AssertTask
Exits the active build, giving an additional message if the single nested condition fails.
This one could as well be implemented as
<macrodef name="assertTrue"> <attribute name="message" default="Assertion failed"/> <element name="assertion" implicit="true"/> <sequential> <fail message="@{message}"> <condition> <assertion/> </condition> </fail> </sequential> </macrodef>but wouldn't be able to throw a specialized exception that way - and the macrodef would nest the exception in yet another BuildException.
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
AssertTask()
|
Method Summary | |
---|---|
void |
execute()
|
void |
setMessage(java.lang.String value)
Message to use when the assertion fails. |
Methods inherited from class org.apache.tools.ant.taskdefs.condition.ConditionBase |
---|
add, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssertTask()
Method Detail |
---|
public void setMessage(java.lang.String value)
public void execute() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |