You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Shawn Beard <sb...@yahoo.com> on 2009/07/24 16:47:48 UTC
Using ANT to validate a URL
We use ANT to deploy applications. Is there a way to have ANT validate the deployment by going to its URL and "Deployment is Valid" from the webpage? Thank you.
Shawn
Re: Using ANT to validate a URL
Posted by David Weintraub <qa...@gmail.com>.
2009/7/24 Júlio Cesar Bueno Cotta <ju...@gmail.com>
> humm..that can help me ..
> just to be sure..
> if the url is www.google.com it is ok..but if the url is
> www.Do_Not_exist.com it is a valid url?
Ran it with the following build.xml
*project>
<condition property="first">
<http url="http://google.com"/>
</condition>
<condition property="second">
<http url="http://does_not_exist.com"/>
</condition>
<echo>first="${first}" second="${second}"</echo>
</project>
*
Got the following output
*$ ant
Buildfile: build.xml
[echo] first="true" second="${second}"
*
The http://google.com set the property "first", but the second one
http://does_not_exist.com doesn't set the property "second" (which is why it
printed out ${second}).
Seems to work fine. However, the format must be a vaild URL format which
means you need to include the protocol and possibly the port.
--
David Weintraub
qazwart@gmail.com
Re: Using ANT to validate a URL
Posted by Júlio Cesar Bueno Cotta <ju...@gmail.com>.
humm..that can help me ..
just to be sure..
if the url is www.google.com it is ok..but if the url is
www.Do_Not_exist.com it is a valid url?
Thanks.
2009/7/24 Shawn Beard <sb...@yahoo.com>
> Yes thats all I need to do is make sure it is valid. Thank you.
>
>
> Shawn
>
>
>
>
> ________________________________
> From: David Weintraub <qa...@gmail.com>
> To: Ant Users List <us...@ant.apache.org>
> Sent: Friday, July 24, 2009 10:00:29 AM
> Subject: Re: Using ANT to validate a URL
>
> On Fri, Jul 24, 2009 at 10:47 AM, Shawn Beard <sb...@yahoo.com>
> wrote:
>
> > We use ANT to deploy applications. Is there a way to have ANT validate
> the
> > deployment by going to its URL and "Deployment is Valid" from the
> webpage?
> > Thank you.
> >
>
>
> You just want to make sure that the URL is valid?
>
> <condition property="url.valid">
> <http url="${test.url}"/>
> </condition>
>
> That will set the property url.valid if the URL ${test.url} is reachable.
>
> --
> David Weintraub
> qazwart@gmail.com
>
>
>
>
>
--
Júlio Cesar Bueno Cotta
Graduando em ciência da computação
Universidade Federal de Viçosa
Re: Using ANT to validate a URL
Posted by Shawn Beard <sb...@yahoo.com>.
Yes thats all I need to do is make sure it is valid. Thank you.
Shawn
________________________________
From: David Weintraub <qa...@gmail.com>
To: Ant Users List <us...@ant.apache.org>
Sent: Friday, July 24, 2009 10:00:29 AM
Subject: Re: Using ANT to validate a URL
On Fri, Jul 24, 2009 at 10:47 AM, Shawn Beard <sb...@yahoo.com> wrote:
> We use ANT to deploy applications. Is there a way to have ANT validate the
> deployment by going to its URL and "Deployment is Valid" from the webpage?
> Thank you.
>
You just want to make sure that the URL is valid?
<condition property="url.valid">
<http url="${test.url}"/>
</condition>
That will set the property url.valid if the URL ${test.url} is reachable.
--
David Weintraub
qazwart@gmail.com
Re: Using ANT to validate a URL
Posted by David Weintraub <qa...@gmail.com>.
On Fri, Jul 24, 2009 at 10:47 AM, Shawn Beard <sb...@yahoo.com> wrote:
> We use ANT to deploy applications. Is there a way to have ANT validate the
> deployment by going to its URL and "Deployment is Valid" from the webpage?
> Thank you.
>
You just want to make sure that the URL is valid?
<condition property="url.valid">
<http url="${test.url}"/>
</condition>
That will set the property url.valid if the URL ${test.url} is reachable.
--
David Weintraub
qazwart@gmail.com