ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Best Practice...
Date Sun, 03 Aug 2003 03:41:56 GMT
On Sun, 3 Aug 2003 07:55 am, Billy Bacon wrote:
> I was wondering how most execute there junit tests from Ant. I've run into
> the problem where Ant hangs when starting up tomcat... I understand why
> it's hanging but I'm wondering how other people have gotten around this
> hump... My steps...
>
> 1.) Build your application via Ant
> 2.) Start Tomcat via Ant
> 3.) Execute Unit Test via Ant (<junit> task)
>
> My problem is that Ant hangs at step 2 and never gets the chance to execute
> my Unit Tests. I've been told that all 3 integrate well but this seems to
> be something that most will encounter and I just want to get an idea of
> what others in the community are doing to get around this.
>

One option is to use the <parallel> task. You start tomcat in one thread. In 
the other thread you wait for tomecat to come up and then run the unit tests. 
Somethign like this:

<parallel>
  <start tomcat ...>
  <sequential>
    <waitfor ...>
    <junit>
    <stop tomcat ...>
  </sequential>
</parallel>

One thing to be careful of with Ant 1.5.3 is that <parallel> will wait for all 
threads to complete. If there is a problem in the junit tests, for example, 
the task to stop tomcat does not run and <parallel> will hang. This is 
addressed in CVS (Ant 1.6).

Conor


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


Mime
View raw message