ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: pingURL: A better way to start and stop application servers?
Date Wed, 12 Feb 2003 07:04:08 GMT
ASAIK there are plans (ideas? wishes?) on the Dev-List for realizing
a async-option (or task) for <java>, <exec> and <apply>.

But I´m not sure - especially when it will be done.

Jan Matèrne

-----Ursprüngliche Nachricht-----
Von: Philip Aston []
Gesendet am: Dienstag, 11. Februar 2003 15:48
An: Ant Users List
Betreff: Re: pingURL: A better way to start and stop application

Philip Aston writes last April:
 > [old thread, I've been busy]

Positively historic now.

 > Steve Loughran writes:
 >  > You can use <waitfor> to probe a url with controlled sleep time
 >  > and timeout interval, sets a property on success, etc.
 >  > 
 >  > All pingurl does is add a container wrapper, but it only allows
 >  > url 2XX conditions to be evaluated (presumably); <waitfor> can
 >  > probe any port for being openable, plus all the other conditions
 >  > that are possible
 > Yep, waitfor is more generic and wins. Roll on 1.5 :-)

I _finally_ got around to trying this. I used something like:

      <target name="start-server">
	    <java><!-- start server --></java>

	  <waitfor><http url="http://localhost:7001/"/></waitfor>

However, this doesn't do the same as:

      <target name="start-server">
	 <pingURL testURL="http://localhost:7001/" waitUntil="alive">
	   <java><!-- start server --></java>

The difference between the two is that the <parallel> construct does
not exit until the server exits, whereas pingURL launches the "start
server" work in its own thread. With pingURL I can have my unit test
targets depend on start-server. AFAICS, I can't achieve the same with
standard ANT tasks.

As a random suggestion, perhaps there could be a "asynchronous" option
for <java> so you could do:

   <java asynchronous="true"><!-- start server --></java>
   <waitfor><http url="http://localhost:7001/"/></waitfor>

Any comments?

- Phil

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message