public class AssertTask
extends org.apache.tools.ant.taskdefs.condition.ConditionBase
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.
Constructor and Description |
---|
AssertTask() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
void |
setMessage(String value)
Message to use when the assertion fails.
|
add, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskName
public void setMessage(String value)
value
- message to use when the assertion failspublic void execute() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
Copyright © 2024 The Apache Software Foundation. All rights reserved.