Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Condition contains question

Condition contains question

2005-06-22       - By EJ Ciramella
Reply:     1     2  

Never mind, string and substring are reversed. . .
On Jun 22, 2005, at 7:06 PM, EJ Ciramella wrote:

> I'm trying the following:
>
>   <loadfile property="grinder.results" srcFile="grinderpass.csv"/>
>   <echo message="${grinder.results}"/>
>   <condition property="hasfailed">
>     <contains string="FAIL" substring="${grinder.results}"  
> casesensitive="false"/>
>   </condition>
>   <fail if="hasfailed" message="${grinder.results}"/>
>
> But even when the file only contains "FAIL" this still goes through  
> stating:
>
> testscp:
> [loadfile] loading /home/source/engineering/main/grinderpass.csv  
> into property grinder.results
> [loadfile] file size = 5
> Setting project property: grinder.results -> FAIL
> [loadfile] loaded 5 characters
> [loadfile] grinder.results := FAIL
>      [echo] FAIL
> Condition false; not setting hasfailed
>
> When run in debug/verbose mode.  Is it looking at the string "$
> {grinder.results}" or the value of this property?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.