You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Pooja Ganapathi <po...@gmail.com> on 2010/04/12 11:46:06 UTC

Using anteater in ant

HI,

I am using anteater testing tool in my ant build, to test few URLS as smoke
test.
So am using the <httprequest>, <match>,<responsecode>, to validate my URLS.
I am trying to capture the result of this testinng with assign attribute as
in match,which i could use later with <if> condition. The anteater manual
page (test tasks) decribes the same,
However, when i try to use the same in my build file, it errs out. below is
the code snippet.

<httprequest>
 <match>
  <regexp assign ="var">${var1}</regexp>
</match>
<if>
<isset property="var"/>
<then>
<do somethin>
</then>
</if>
</httprequest>

The same code example as been given in the manuals too. however, when ran it
gave the below error.
"The <httpRequest> task doesn't support the nested "if" element."
 
Any help please?

Regards,
Pooja




-- 
View this message in context: http://old.nabble.com/Using-anteater-in-ant-tp28215650p28215650.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: AW: Using anteater in ant

Posted by Ja...@rzf.fin-nrw.de.
No idea.
Have you asked on the anteater user list?

Jan 

> -----Ursprüngliche Nachricht-----
> Von: Pooja Ganapathi [mailto:pooja.ganapathi@gmail.com] 
> Gesendet: Mittwoch, 14. April 2010 07:09
> An: user@ant.apache.org
> Betreff: Re: AW: Using anteater in ant
> 
> 
> hi,
> 
> here is the URL -->
> http://aft.sourceforge.net/manual/Test%20tasks.html#elem:responseCode
> 
> If you just scroll down, you might see the code like this :
> 
> **********************************************
> 
> This is useful in conjunction with a property setter:
> 
> <httpRequest href="some URL">
>   <match assign="ok">
>     <responseCode pattern="2.."/>
>   </match>
>   <match assign="redirected">
>     <responseCode pattern="3.."/>
>   </match>
>   <if>
>     <isset property="redirected"/>
>     <then>
>       <echo>We were redirected... </echo>
>     </then>
>   </if>
> </httpRequest>
> *******************************************************
> 
> As with using <if>, outside <httprequest>, the build doesn't 
> recognise it.
> Say that the build fails in the match.. and thus 'var' is not 
> assigned. It
> doesn't go to the if statement et all..but directly..it fails.
> 
> I have put the <httprequest> under <trycatch> and thus, as soon as it
> encounters error, it goes to <catch> and fails out.
> 
> -Pooja
> 
> 
> Jan.Materne wrote:
> > 
> >> in match,which i could use later with <if> condition. The 
> >> anteater manual page (test tasks) decribes the same,
> > 
> > I havent found that on http://aft.sourceforge.net/ could 
> you post the
> > url?
> > 
> > 
> > 
> >> <httprequest>
> >>  <match>
> >>   <regexp assign ="var">${var1}</regexp>
> >> </match>
> >> <if>
> >> <isset property="var"/>
> >> <then>
> >> <do somethin>
> >> </then>
> >> </if>
> >> </httprequest>
> >> 
> >> The same code example as been given in the manuals too. 
> >> however, when ran it
> >> gave the below error.
> >> "The <httpRequest> task doesn't support the nested "if" element."
> >>  
> >> Any help please?
> > 
> > 
> > Maybe the if/then/else should be outside of <httprequest> and done
> > external tasks?
> > 
> > <aft:httprequest>
> >     <aft:match>
> >         <aft:regexp assign="var"....
> > </aft:httprequest>
> > <antcontrib:if>
> >     <isset property="var"/>
> >     <antcontrib:then> ....
> > </antcontrib:if>
> > 
> > 
> > Jan
> > 
> > 
> >> 
> >> Regards,
> >> Pooja
> >> 
> >> 
> >> 
> >> 
> >> -- 
> >> View this message in context: 
> >> 
> http://old.nabble.com/Using-anteater-in-ant-tp28215650p28215650.html
> >> Sent from the Ant - Users mailing list archive at Nabble.com.
> >> 
> >> 
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail: user-help@ant.apache.org
> >> 
> >> 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Using-anteater-in-ant-tp28215650p28238396.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: AW: Using anteater in ant

Posted by Pooja Ganapathi <po...@gmail.com>.
hi,

here is the URL -->
http://aft.sourceforge.net/manual/Test%20tasks.html#elem:responseCode

If you just scroll down, you might see the code like this :

**********************************************

This is useful in conjunction with a property setter:

<httpRequest href="some URL">
  <match assign="ok">
    <responseCode pattern="2.."/>
  </match>
  <match assign="redirected">
    <responseCode pattern="3.."/>
  </match>
  <if>
    <isset property="redirected"/>
    <then>
      <echo>We were redirected... </echo>
    </then>
  </if>
</httpRequest>
*******************************************************

As with using <if>, outside <httprequest>, the build doesn't recognise it.
Say that the build fails in the match.. and thus 'var' is not assigned. It
doesn't go to the if statement et all..but directly..it fails.

I have put the <httprequest> under <trycatch> and thus, as soon as it
encounters error, it goes to <catch> and fails out.

-Pooja


Jan.Materne wrote:
> 
>> in match,which i could use later with <if> condition. The 
>> anteater manual page (test tasks) decribes the same,
> 
> I havent found that on http://aft.sourceforge.net/ could you post the
> url?
> 
> 
> 
>> <httprequest>
>>  <match>
>>   <regexp assign ="var">${var1}</regexp>
>> </match>
>> <if>
>> <isset property="var"/>
>> <then>
>> <do somethin>
>> </then>
>> </if>
>> </httprequest>
>> 
>> The same code example as been given in the manuals too. 
>> however, when ran it
>> gave the below error.
>> "The <httpRequest> task doesn't support the nested "if" element."
>>  
>> Any help please?
> 
> 
> Maybe the if/then/else should be outside of <httprequest> and done
> external tasks?
> 
> <aft:httprequest>
>     <aft:match>
>         <aft:regexp assign="var"....
> </aft:httprequest>
> <antcontrib:if>
>     <isset property="var"/>
>     <antcontrib:then> ....
> </antcontrib:if>
> 
> 
> Jan
> 
> 
>> 
>> Regards,
>> Pooja
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context: 
>> http://old.nabble.com/Using-anteater-in-ant-tp28215650p28215650.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Using-anteater-in-ant-tp28215650p28238396.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: Using anteater in ant

Posted by Ja...@rzf.fin-nrw.de.
> in match,which i could use later with <if> condition. The 
> anteater manual page (test tasks) decribes the same,

I havent found that on http://aft.sourceforge.net/ could you post the
url?



> <httprequest>
>  <match>
>   <regexp assign ="var">${var1}</regexp>
> </match>
> <if>
> <isset property="var"/>
> <then>
> <do somethin>
> </then>
> </if>
> </httprequest>
> 
> The same code example as been given in the manuals too. 
> however, when ran it
> gave the below error.
> "The <httpRequest> task doesn't support the nested "if" element."
>  
> Any help please?


Maybe the if/then/else should be outside of <httprequest> and done
external tasks?

<aft:httprequest>
    <aft:match>
        <aft:regexp assign="var"....
</aft:httprequest>
<antcontrib:if>
    <isset property="var"/>
    <antcontrib:then> ....
</antcontrib:if>


Jan


> 
> Regards,
> Pooja
> 
> 
> 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Using-anteater-in-ant-tp28215650p28215650.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org