ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Hatton" <khat...@axiomsystems.com>
Subject <parallel>/<sequential>/<copy>
Date Tue, 01 Jul 2003 09:51:58 GMT
Hi,

Can anyone explain the following?

I am running my test cases by starting an application server in <parallel> with a <sequential>
set of tasks to wait for the server, run the tests, and shutdown the server. (There are snippets
of the relevant Ant targets at the end of the mail).

Before starting the server, I <copy> the jcoverage.ser file to the appserver directory;
after it has shutdown, I <copy> it back to my working directory.

Intermittently, I find that the last <copy> back to the working directory is not always
executed - there is no [copy] in the console when this happens. Consequently all my reports
go awry. Of course, this never happens when I run ant -debug ...

Environment is Win 2000, Ant 1.5.3, JBoss 3.2.1.

Thanks for any help,
Keith



    <!-- JBoss targets -->
    
    <target name="start-jboss">
        <copy file="${distrib}/${ear}" todir="${jboss.home}/server/default/deploy"/>
        <copy file="jcoverage.ser" todir="${jboss.home}/bin"/>
        <!-- start JBoss -->
        <exec dir="${jboss.home}/bin" executable="cmd.exe" os="Windows 2000" output="jboss.out">
            <arg line="/c run.bat"/>
            <env key="NOPAUSE" value="true"/>
        </exec>
        <copy file="${jboss.home}/bin/jcoverage.ser" todir="."/> <!-- THIS IS THE
PROBLEM TASK -->
    </target>
    
    <target name="waitfor-jboss">
        <!-- wait for jboss 
             This should really check the output for the startup message, but in practice
             waiting for this URL seems to work OK -->
        <waitfor maxwait="120" maxwaitunit="second" checkevery="20" checkeveryunit="second">
            <http url="http://localhost:8080/jmx-console"/>
        </waitfor>
    </target>
    
    <target name="stop-jboss">
        <!-- stop JBoss -->
        <exec dir="${jboss.home}/bin" executable="cmd.exe" os="Windows 2000">
            <arg line="/c shutdown.bat -S"/>
            <env key="NOPAUSE" value="true"/>
        </exec>
    </target>


    
    <!-- Run unit tests within application server -->
    
    <target name="junit" depends="compile:junit">
        <parallel>
            <!-- Start App Server -->
            <ant antfile="appservers.xml" target="start-${appserver}"/>
            
            <sequential>
                <!-- Wait for App Server -->
                <ant antfile="appservers.xml" target="waitfor-${appserver}"/>
                <echo>Application server has started</echo>
                
                <!-- Run test cases -->
                <ant antfile="test.xml" target="junit:Customer" inheritrefs="true"/>
                
                <!-- Stop App Server -->
                <ant antfile="appservers.xml" target="stop-${appserver}"/>
            </sequential>
        </parallel>
    </target>
    



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


Mime
View raw message