Title: [cactus] Using Cactus with JBoss-2.2.1 with Embedded Tomcat
Jeffrey,
 
After looking more closely at the scripts you provided I noticed that you copied the test war file to the location where JBoss/Tomcat is installed. This is fine but I have been trying to follow a different approach so far with all other scripts for other containers (I'm not sure it is a correct approach either ... !). I have always configured the servlet engines so that the test webapp would execute in it's own directory (named out in the cactus sample) so that :
- it would not interfere with other applications that might be installed in the servlet engine,
- it is a bit faster as the servlet engine does not have to load/setup the other webapps,
- we can have dedicated servlet engine configuration files for the test,
- do not "pollute" the servlet engine with test webapps
 
So far, I have found that it was an easy thing to do as all servlet engine give you the freedom to configure where you put the webapps.
If you have some time, would you be able to help me rewrite the 'prepare_tests_jboss_221' target to work this way ? (You can check how it works on Tomcat 3.2 to understand better what I meant above) ?
 
Thanks a lot.
Vincent.
----- Original Message -----
Sent: Saturday, June 09, 2001 2:20 AM
Subject: [cactus] Using Cactus with JBoss-2.2.1 with Embedded Tomcat

Since I have not seen anything posted on this archive regarding
usage of jboss-2.2.1 with embedded tomcat and cactus, here is a snippet from build.xml
which successfully starts and stops JBoss.

Cactus creators:  Thanks for creating cactus.  It is great!!

    <target name="tests_jboss_221" depends="init,prepare_tests_jboss_221" if="jboss.home.221">
        <!-- Start the servlet engine, wait for it to be started, run the
             unit tests, stop the servlet engine, wait for it to be stopped.
             The servlet engine is stopped if the tests fail for any reason -->
        <runservertests testURL="http://localhost:8080/test"
            startTarget="start_jboss_221"
            stopTarget="stop_jboss_221"
            testTarget="cactustests"/>
    </target>
    <target name="start_jboss_221">
        <java classname="org.jboss.Main" fork="yes" dir="${jboss.home.221}/bin">
             <classpath>
                <pathelement location="${java.home}/../lib/tools.jar"/>
                <fileset dir="${jboss.home.221}/bin">
                    <include name="run.jar"/>
                </fileset>
            </classpath>
        </java>
    </target>
    <target name="stop_jboss_221">
        <java classname="org.jboss.Shutdown" fork="yes">
            <classpath>
                <pathelement location="${java.home}/../lib/tools.jar"/>
                <fileset dir="${jboss.home.221}/lib/ext">
                    <include name="jboss.jar"/>
                </fileset>
            </classpath>
        </java>
    </target>
    <target name="check_tests_jboss_221" depends="testwar" unless="jboss.home.221">
        <echo message=""/>
        <echo message="*********************************************************"/>
        <echo message="WARNING : The 'jboss.home.221' property has not been set."/>
        <echo message="          No test will be run on that servlet engine."/>
        <echo message="*********************************************************"/>
        <echo message=""/>
    </target>

    <target name="prepare_tests_jboss_221" depends="check_tests_jboss_221" if="jboss.home.221">
          <property name="tomcat.home.32" value="${tomcat.home.32}"/>
        <filter token="tomcat.home.32" value="${tomcat.home.32}"/>
        <!-- Delete some config file so that they will be copied every time -->
        <delete file="${tomcat.home.32}/conf/tomcat.conf"/>
        <!-- Copy the war file -->
        <copy file="${build.dir}/test.war" tofile="${jboss.home.221}/deploy/test.war"/>
    </target>

Reply via email to