You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2003/01/23 15:09:24 UTC

cvs commit: jakarta-cactus/petals/ant/src/scripts/j2ee13 build-tests-jboss3x.xml build.xml

vmassol     2003/01/23 06:09:24

  Modified:    petals/ant/src/scripts/j2ee13 build.xml
  Added:       petals/ant/src/scripts/share build-tests-tomcat4x.xml
               petals/ant/src/scripts/j2ee13 build-tests-jboss3x.xml
  Removed:     petals/ant/src/scripts/share build-tests-tomcat-40.xml
  Log:
  - Added JBoss 3.x scripts (kinda works but far from perfect. When jboss stops, it hangs and the Ant script cannot continue - Any idea?)
  - Renamed the tomcat 4.x script
  
  Revision  Changes    Path
  1.1                  jakarta-cactus/petals/ant/src/scripts/share/build-tests-tomcat4x.xml
  
  Index: build-tests-tomcat4x.xml
  ===================================================================
  
  	<!-- Global properties -->
      <property name="conf.tomcat4x.dir" value="${conf.dir}/tomcat4x"/>
      <property name="cactus.target.tomcat4x" value="${cactus.target.dir}/tomcat4x"/>
  
      <!--
         ========================================================================
           Run Tomcat 4.x tests
         ========================================================================
      -->
      <target name="cactus.run.tomcat4x" 
      	depends="cactus.init,cactus.setup.tomcat4x,cactus.war,cactus.deploy.tomcat4x"
          if="cactus.home.tomcat4x" description="Run tests on Tomcat 4.x">
  
          <!-- 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:${cactus.port}/test/ServletRedirector?Cactus_Service=RUN_TEST"
              startTarget="cactus.start.tomcat4x"
              stopTarget="cactus.stop.tomcat4x"
              testTarget="cactus.test"/>
  
      </target>
  
      <!--
         ========================================================================
           Start Tomcat 4.x
         ========================================================================
      -->
      <target name="cactus.start.tomcat4x" description="Start Tomcat 4.x"
          depends="cactus.check.tomcat4x" if="cactus.home.tomcat4x">
  
          <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
  
              <jvmarg value="-Dcatalina.home=${cactus.home.tomcat4x}"/>
              <jvmarg value="-Dcatalina.base=${cactus.target.tomcat4x}"/>
  
              <arg value="start"/>
              <classpath>
  
                <!-- These are ignored if -Dbuild.sysclasspath=only is used -->
                <pathelement path="${java.home}/../lib/tools.jar"/>
                <fileset dir="${cactus.home.tomcat4x}">
                    <include name="bin/bootstrap.jar"/>
                </fileset>
  
              </classpath>
          </java>
  
      </target>
  
      <!--
         ========================================================================
           Stop Tomcat 4.x
         ========================================================================
      -->
      <target name="cactus.stop.tomcat4x" description="Stop Tomcat 4.x"
          depends="cactus.check.tomcat4x" if="cactus.home.tomcat4x">
  
          <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
              <jvmarg value="-Dcatalina.home=${cactus.home.tomcat4x}"/>
              <jvmarg value="-Dcatalina.base=${cactus.target.tomcat4x}"/>
              <arg value="stop"/>
  
              <classpath>
                <!-- These are ignored if -Dbuild.sysclasspath=only is used
                     (this is the case for Gump builds) -->
                <fileset dir="${cactus.home.tomcat4x}">
                    <include name="bin/bootstrap.jar"/>
                </fileset>
              </classpath>
          </java>
  
      </target>
  
      <!--
         ========================================================================
           Display a warning message if the needed servlet engine home property
           is not set
         ========================================================================
      -->
      <target name="cactus.check.tomcat4x" unless="cactus.home.tomcat4x">
  
          <echo message=""/>
          <echo message="******************************************************"/>
          <echo message="WARNING : The 'cactus.home.tomcat4x' property has not"/>
          <echo message="been set. No test will be run on that servlet engine."/>
          <echo message="******************************************************"/>
          <echo message=""/>
  
      </target>
  
      <!--
         ========================================================================
           Deploy the cactified webapp
         ========================================================================
      -->
      <target name="cactus.deploy.tomcat4x" 
      	description="Deploy the webapp on Tomcat 4.x">
  
          <!-- Copy the webapp -->
  		<copy todir="${cactus.target.tomcat4x}/webapps/test">
  			<fileset dir="${cactus.target.dir}/test"/>
  		</copy>
  
  	</target>
  	
      <!--
         ========================================================================
           Set up a valid Tomcat 4.x directory structure in the
           cactus.target.tomcat4x directory.
         ========================================================================
      -->
      <target name="cactus.setup.tomcat4x"
          depends="cactus.check.tomcat4x" if="cactus.home.tomcat4x"
          description="Set up a Tomcat 4.x directory structure">
  
          <!-- Create work and conf directories and copy configuration files -->
          <mkdir dir="${cactus.target.tomcat4x}/conf"/>
          <mkdir dir="${cactus.target.tomcat4x}/work"/>
          <mkdir dir="${cactus.target.tomcat4x}/webapps"/>
  
          <!-- Delete some config file so that they will be copied every time -->
          <delete file="${cactus.target.tomcat4x}/conf/server.xml"/>
  
          <!-- Remove the auto deployed webapp so that it is redeployed every
               time -->
          <delete dir="${cactus.target.tomcat4x}/webapps/test"/>
  
          <copy todir="${cactus.target.tomcat4x}/conf" filtering="on">
              <fileset dir="${conf.tomcat4x.dir}"/>
          </copy>
  
          <!-- Copy the Tomcat web.xml - We need to copy this file as it has
               changed between Tomcat 4.x versions and one version of it doesn't
               work with another version of Tomcat 4 -->
          <copy file="${cactus.home.tomcat4x}/conf/web.xml"
              todir="${cactus.target.tomcat4x}/conf"/>
  
      </target>
  
  
  
  1.2       +4 -4      jakarta-cactus/petals/ant/src/scripts/j2ee13/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/petals/ant/src/scripts/j2ee13/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml	23 Jan 2003 12:32:25 -0000	1.1
  +++ build.xml	23 Jan 2003 14:09:24 -0000	1.2
  @@ -2,7 +2,8 @@
   
   <!DOCTYPE project [
       <!ENTITY build-share SYSTEM "file:./scripts/build-share.xml">
  -    <!ENTITY build-tests-tomcat-40 SYSTEM "file:./scripts/build-tests-tomcat-40.xml">
  +    <!ENTITY build-tests-tomcat4x SYSTEM "file:./scripts/build-tests-tomcat4x.xml">
  +    <!ENTITY build-tests-jboss3x SYSTEM "file:./scripts/build-tests-jboss3x.xml">
   <!--
       <!ENTITY build-tests-resin-20 SYSTEM "file:./scripts/build-tests-resin-20.xml">
       <!ENTITY build-tests-resin-13 SYSTEM "file:./scripts/build-tests-resin-13.xml">
  @@ -11,7 +12,6 @@
       <!ENTITY build-tests-orion-16 SYSTEM "file:./scripts/build-tests-orion-16.xml">
       <!ENTITY build-tests-weblogic-61 SYSTEM "file:./scripts/build-tests-weblogic-61.xml">
       <!ENTITY build-tests-weblogic-70 SYSTEM "file:./scripts/build-tests-weblogic-70.xml">
  -    <!ENTITY build-tests-jboss-3x SYSTEM "file:./scripts/build-tests-jboss-3x.xml">
   -->
   ]>
   
  @@ -55,7 +55,8 @@
   
       &build-share;
   
  -    &build-tests-tomcat-40;
  +    &build-tests-tomcat4x;
  +    &build-tests-jboss3x;
   <!--
       &build-tests-resin-20;
       &build-tests-resin-13;
  @@ -64,6 +65,5 @@
       &build-tests-orion-16;
       &build-tests-weblogic-61;
       &build-tests-weblogic-70;
  -    &build-tests-jboss-3x;
   -->
   </project>
  
  
  
  1.1                  jakarta-cactus/petals/ant/src/scripts/j2ee13/build-tests-jboss3x.xml
  
  Index: build-tests-jboss3x.xml
  ===================================================================
  
  	<!-- Global properties -->
      <property name="conf.jboss3x.dir" value="${conf.dir}/jboss3x"/>
      <property name="cactus.target.jboss3x" value="${cactus.target.dir}/jboss3x"/>
  
      <!-- 
         ========================================================================
           Run JBoss 3.x tests
         ========================================================================
      -->
      <target name="cactus.run.jboss3x"
      	depends="cactus.init,cactus.setup.jboss3x,cactus.war,cactus.deploy.jboss3x"
          if="cactus.home.jboss3x" description="Run tests on JBoss 3.x">
  
          <!-- Start the container, wait for it to be started, run the
               unit tests, stop the container, wait for it to be stopped.
               The container is stopped if the tests fail for any reason -->
  
          <runservertests
              testURL="http://localhost:${cactus.port}/test/ServletRedirector?Cactus_Service=RUN_TEST"
              startTarget="cactus.start.jboss3x"
              stopTarget="cactus.stop.jboss3x"
              testTarget="cactus.test"/>
  
      </target>
  
      <!-- 
         ========================================================================
           Start JBoss 3.x
         ========================================================================
      -->
      <target name="cactus.start.jboss3x" description="Start JBoss 3.x"
          depends="cactus.check.jboss3x" if="cactus.home.jboss3x">
  
  		<dirname property="antfile.dir" file="${ant.file}"/>
  
          <java classname="org.jboss.Main" fork="yes">
  
              <jvmarg value="-Dprogram.name=${cactus.home.jboss3x}/bin/run.bat"/>
              <jvmarg value="-Djboss.server.home.dir=${cactus.target.jboss3x}/server/cactus"/>
              <jvmarg value="-Djboss.server.home.url=file:/${cactus.target.jboss3x}/server/cactus"/>
              
              <arg line="-c cactus"/>
              
              <classpath>
                  <pathelement location="${cactus.home.jboss3x}/bin/run.jar"/>
  				<pathelement path="${java.home}/../lib/tools.jar"/>
              </classpath>
  
          </java>
  
      </target>
  
      <!-- 
         ========================================================================
           Stop JBoss 3.x
         ========================================================================
      -->
      <target name="cactus.stop.jboss3x" description="Stop JBoss 3.x"
          depends="cactus.check.jboss3x" if="cactus.home.jboss3x">
  
          <java classname="org.jboss.Shutdown" fork="yes">
  
              <arg value="localhost"/>
              <arg value="${cactus.port}"/>
              
              <classpath>
                  <pathelement location="${cactus.home.jboss3x}/bin/shutdown.jar"/>
              </classpath>
  
          </java>
  
      </target>
  
      <!-- 
         ========================================================================
           Display a warning message if the needed container home property
           is not set
         ========================================================================
      -->
      <target name="cactus.check.jboss3x" unless="cactus.home.jboss3x">
  
          <echo message=""/>
          <echo message="******************************************************"/>
          <echo message="WARNING : The 'cactus.home.jboss3x' property has not"/>
          <echo message="been set. No test will be run on that container."/>
          <echo message="******************************************************"/>
          <echo message=""/>
  
      </target>
  
      <!--
         ========================================================================
           Deploy the cactified webapp
         ========================================================================
      -->
      <target name="cactus.deploy.jboss3x" 
      	description="Deploy the webapp on JBoss 3.x">
  
  		<!-- Note: It seems JBoss requires a war file in its deploy directory. 
  		     It fails to deploy an expanded webapp (something may need to be
  		     configured to allow this?). -->
  		    
          <!-- Copy the webapp -->
  		<mkdir dir="${cactus.target.jboss3x}/tmp/test"/>
  		<copy todir="${cactus.target.jboss3x}/tmp/test">
  			<fileset dir="${cactus.target.dir}/test"/>
  		</copy>
  
          <!-- Add the JBoss specific configuration files -->
  		<copy todir="${cactus.target.jboss3x}/tmp/test/WEB-INF/classes">
              <fileset dir="${conf.jboss3x.dir}">
                  <include name="*.properties"/>
              </fileset>
          </copy>
  
  		<jar destfile="${cactus.target.jboss3x}/server/cactus/deploy/test.war">
  			<fileset dir="${cactus.target.jboss3x}/tmp/test"/>
  		</jar>
  
  	</target>
  
      <!--
         ========================================================================
           Set up a valid JBoss 3.x directory structure in the
           cactus.target.jboss3x directory.
         ========================================================================
      -->
      <target name="cactus.setup.jboss3x"
          depends="cactus.check.jboss3x" if="cactus.home.jboss3x"
          description="Set up a JBoss 3.x directory structure">
  
          <!-- Create a server configuration using the minimal JBoss 
               configuration and adding the JBossWeb Service -->
          <copy todir="${cactus.target.jboss3x}/server/cactus">
              <fileset dir="${cactus.home.jboss3x}/server/minimal"/>
          </copy>
  
          <copy todir="${cactus.target.jboss3x}/server/cactus/deploy/jbossweb.sar">
              <fileset dir="${cactus.home.jboss3x}/server/default/deploy/jbossweb.sar"/>
          </copy>
          <copy todir="${cactus.target.jboss3x}/server/cactus/lib">
              <fileset dir="${cactus.home.jboss3x}/server/default/lib">
                  <include name="javax.servlet.jar"/>
                  <include name="jboss.jar"/>
              </fileset>
          </copy>
  
      </target>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>