ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gardner, Chris" <Chris.Gard...@McKesson.com>
Subject RE: Killing Forked JVMs (was RE: Killing Forked Jams)
Date Fri, 12 Sep 2003 21:10:20 GMT
I actually use parallel and sequential.  wlstop gives you the capability
to stop the server.  Unfortunately, the server that I'm using
(www.fitnesse.org) does not provide an ant means to start and stop it.
I have to start it using the <java> task.  The only way that I can see
to do exactly what I want is to write a custom ant task or require the
developers to always have the fitnesse server running on their machines.
Here is my script:

<!-- Allows users to run the server by itself without having to run the
tests from ant. --> 
  <target name="run-fitnesse-server" description="Runs the FitNesse
Wiki."> 
    <java classname="fitnesse.Fitnesse" fork="true" 
          dir="${accept-test-server.home}"> 
       <classpath> 
         <fileset refid="fitnesse.jars" /> 
       </classpath> 
       <arg line="-p ${accept-test-server.port}" /> 
     </java> 
  </target> 

  <target name="accept-test" description="Runs the acceptance tests."> 
    <parallel> 
      <antcall target="run-fitnesse-server" /> 

      <sequential> 
        <waitfor maxwait="5" maxwaitunit="minute"> 
          <socket server="${accept-test-server.name}" 
                  port="${accept-test-server.port}" /> 
        </waitfor> 

        <java classname="fitnesse.TestRunner" failonerror="true"
fork="true" 
              dir="${accept-test-server.home}"> 
          <classpath> 
            <fileset refid="fitnesse.jars" /> 
          </classpath> 
          <arg line="-v ${accept-tests-to-run}" /> 
        </java> 

      </sequential> 
    </parallel> 
  </target> 

-----Original Message----- 
From: Antoine Lévy-Lambert [ mailto:antoine@antbuild.com
<mailto:antoine@antbuild.com> ] 
Sent: Friday, September 12, 2003 3:40 PM 
To: Ant Users List 
Subject: AW: Killing Forked JVMs (was RE: Killing Forked Jams) 


The parallel task might be useful for you : 

from the documentation : ( 
http://ant.apache.org/manual/CoreTasks/parallel.html
<http://ant.apache.org/manual/CoreTasks/parallel.html>  ) 
------------------------------------------------------------------------
---- 
------------- 
<parallel> 
  <wlrun ... > 
  <sequential> 
    <sleep seconds="30"/> 
    <junit ... > 
    <wlstop/> 
  </sequential> 
</parallel> 

This example represents a typical pattern for testing a server
application. 
In one thread the server is started (the wlrun task). The other thread 
consists of a three tasks which are performed in sequence. The sleep
task is 
used to give the server time to come up. Another task which is capable
of 
validating that the server is available could be used in place of the
sleep 
task. The test harness is then run. Once the tests are complete, the
server 
is stopped (using wlstop in this example), allowing both threads to 
complete. The parallel task will also complete at this time and the
build 
will then continue. 
------------------------------------------------------------------------
---- 
------------- 

Antoine 

-----Urspr√ľngliche Nachricht----- 
Von: Gardner, Chris [ mailto:Chris.Gardner@McKesson.com
<mailto:Chris.Gardner@McKesson.com> ] 
Gesendet: Freitag, 12. September 2003 15:24 
An: 'Ant Users List' 
Betreff: Killing Forked JVMs (was RE: Killing Forked Jams) 



My spell checker changed JVM to JAM.  Sorry. 

-----Original Message----- 
From: Gardner, Chris [ mailto:Chris.Gardner@McKesson.com
<mailto:Chris.Gardner@McKesson.com>  
< mailto:Chris.Gardner@McKesson.com <mailto:Chris.Gardner@McKesson.com>
> ] 
Sent: Friday, September 12, 2003 9:21 AM 
To: 'user@ant.apache.org' 
Subject: Killing Forked Jams 


Is there a built-in mechanism in ant to kill forked Jams?  In my case, 
I'm using <java fork="true"> to launch a server process that I run tests


against.  This server process is a small, specialized http server 
(www.fitnesse.org) that has no accompanying ant tasks.  I have to fork 
the JAM because the server process depends on the value of the dir 
attribute of <java>.  When the tests are finished, the build does not 
finish because it is waiting on the forked JAM to complete. 

I don't want to use the <java> timeout attribute because I have no way 
of knowing how long those tests will take. 

Any suggestions? 

Thanks. 

CRAG 




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


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