You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by bi...@thirty3.net on 2003/08/01 19:15:51 UTC

Junit target not being executed by Ant

I'm not sure why or how this started but my junit tests
are not being executed via Ant. 

I have an ant target which starts tomcat and I have
another target which calls the <junit> task to execute
my unit tests...

My deploy.test target depends on starting tomcat and
then makes an <antcall target> to my 'test' target
which executes my tests. It seems to be hanging after
tomcat is started successfully. Has anyone come across
this issue before.

Example: 
<target name="deploy.test" depends="clean, tc">
<!-- clean target just deletes the build dir -->
<!-- tc target starts tomcat -->
<antcall target="test"> <!-- executes unit tests -->
</target>


Thanks for any help...

- Billy -

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


Re: Junit target not being executed by Ant

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
> My deploy.test target depends on starting tomcat and
> then makes an <antcall target> to my 'test' target
> which executes my tests. It seems to be hanging after
> tomcat is started successfully. Has anyone come across
> this issue before.
>


ant 1.5.3 cannot "spawn" processes like tomcat.
have a look at this posting from Bill Burton :
http://marc.theaimsgroup.com/?l=ant-user&m=104322316306620&w=2
Subject:  [SUBMIT] Support for detached <exec> on Unix and Windows

in ant1.6alpha, the exec task has a spawn attribute.

it works like that

<exec executable="cmd.exe" spawn="true">
     <arg value="/C"/>
     <arg value="start-tomcat.bat"/>
      <arg value=">NUL"/>
</exec>
not the >NUL this is to redired the stdout of the start-tomcat.bat to the
nirvana, otherwise the spawned process crashes.
Or you can write your own wrapper to redirect the output to a log file.

Cheers,

Antoine




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