You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ma...@apache.org on 2004/03/22 08:16:37 UTC
cvs commit: jakarta-struts/conf/test/tomcat50 server.xml
martinc 2004/03/21 23:16:37
Modified: . build-tests.xml build.xml
Added: conf/test/tomcat50 server.xml
Log:
Add initial support for Cactus tests running against Tomcat 5.0. The tests
themselves run just fine, but for some reason Tomcat doesn't stop once the
tests have completed. (I have not added the 5.0 targets to the test suite
because of this.)
Revision Changes Path
1.25 +83 -0 jakarta-struts/build-tests.xml
Index: build-tests.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/build-tests.xml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- build-tests.xml 10 Oct 2003 22:09:26 -0000 1.24
+++ build-tests.xml 22 Mar 2004 07:16:37 -0000 1.25
@@ -631,6 +631,89 @@
</target>
+<!--
+ Prepare test directory structure for Tomcat 5.0 servlet engine
+-->
+ <target name="prepare.test.tomcat.50" depends="prepare.test.war" if="tomcat.home.50">
+
+ <property name="out.tomcat.50.dir" value="${out.test.dir}/servers/tomcat50"/>
+ <filter token="out.tomcat.50.full.dir" value="${out.tomcat.50.dir}"/>
+ <filter token="tomcat.connector.port" value="${cactus.contextPort}"/>
+
+ <mkdir dir="${out.tomcat.50.dir}/webapps"/>
+ <mkdir dir="${out.tomcat.50.dir}/conf"/>
+
+ <!-- Delete old directory so new war is unzipped -->
+ <delete dir="${out.tomcat.50.dir}/webapps/test"/>
+
+ <!-- Copy war file -->
+ <copy file="${out.test.dir}/test.war" todir="${out.tomcat.50.dir}/webapps"/>
+
+ <!-- Copy configuration files -->
+ <copy file="${conf.test.dir}/tomcat50/server.xml"
+ todir="${out.tomcat.50.dir}/conf" filtering="on"/>
+
+ </target>
+
+<!--
+ Run unit tests on Tomcat 5.0 servlet engine
+-->
+ <target name="test.tomcat.50" depends="prepare.test.tomcat.50">
+
+ <!-- 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 automatically stopped if the tests fail for
+ any reason.-->
+
+ <runservertests testURL="${cactus.contextURL}"
+ startTarget="start.tomcat.50"
+ stopTarget="stop.tomcat.50"
+ testTarget="run.test"/>
+
+ </target>
+
+<!--
+ Start Tomcat 5.0 servlet engine
+-->
+ <target name="start.tomcat.50">
+
+ <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
+ <jvmarg value="-Dcatalina.home=${tomcat.home.50}"/>
+ <jvmarg value="-Dcatalina.base=${tomcat.home.50}"/>
+ <arg value="-config"/>
+ <arg value="${out.tomcat.50.dir}/conf/server.xml"/>
+ <arg value="start"/>
+ <classpath>
+ <pathelement location="${java.home}/../lib/tools.jar"/>
+ <fileset dir="${tomcat.home.50}">
+ <include name="bin/bootstrap.jar"/>
+<!-- <include name="server/catalina.jar"/> -->
+ </fileset>
+ </classpath>
+ </java>
+
+ </target>
+
+<!--
+ Stop Tomcat 5.0 servlet engine
+-->
+ <target name="stop.tomcat.50">
+
+ <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
+ <jvmarg value="-Dcatalina.home=${tomcat.home.50}"/>
+ <jvmarg value="-Dcatalina.base=${tomcat.home.50}"/>
+ <arg value="-config"/>
+ <arg value="${out.tomcat.50.dir}/conf/server.xml"/>
+ <arg value="stop"/>
+ <classpath>
+ <fileset dir="${tomcat.home.50}">
+ <include name="bin/bootstrap.jar"/>
+<!-- <include name="server/catalina.jar"/> -->
+ </fileset>
+ </classpath>
+ </java>
+
+ </target>
<!-- ================ Non-Cactus JUnit Based Tests ======================== -->
1.131 +16 -0 jakarta-struts/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/build.xml,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -r1.130 -r1.131
--- build.xml 29 Feb 2004 22:55:45 -0000 1.130
+++ build.xml 22 Mar 2004 07:16:37 -0000 1.131
@@ -868,6 +868,22 @@
</target>
+ <target name="skip.tomcat.50" unless="tomcat.home.50">
+ <echo message="*****************************************************"/>
+ <echo message="WARNING : Property 'tomcat.home.50' has not been set."/>
+ <echo message=" No test will be run on that servlet engine."/>
+ <echo message="*****************************************************"/>
+ <echo message=""/>
+ </target>
+
+ <target name="test.tomcat.50" if="tomcat.home.50"
+ depends="skip.tomcat.50,compile.library"
+ description="Run unit tests on Tomcat 5.0">
+ <echo message="tomcat.home.50 = ${tomcat.home.50}"/>
+ <ant antfile="build-tests.xml" target="test.tomcat.50"/>
+ </target>
+
+
<!-- ========== Non-Cactus Unit Tests ================================= -->
<target name="test.junit" depends="compile.library"
1.1 jakarta-struts/conf/test/tomcat50/server.xml
Index: server.xml
===================================================================
<Server port="9005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="@tomcat.connector.port@"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
<Engine name="Standalone" defaultHost="localhost" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="@out.tomcat.50.full.dir@"
prefix="cactus_test"
suffix=".log"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase" />
<Host name="localhost" debug="0" appBase="@out.tomcat.50.full.dir@/webapps">
</Host>
</Engine>
</Service>
</Server>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org