| <project name="Struts Unit Tests" default="test.tomcat.32" basedir="."> |
| |
| <!-- |
| This is a generic build.xml file for Ant that is used to run the |
| Struts unit tests. This build file *must* be called from the |
| build.xml file in order to inherit most of it's needed properties |
| (See below for the list of these properties). |
| --> |
| |
| <!-- ========== Prerequisite Properties =================================== --> |
| |
| |
| <!-- |
| These properties MUST be set on the "ant" command line, the "antrc" |
| properties file in your home directory, or from settings in a superior |
| build.xml script. |
| |
| build.home Base directory into which we are building |
| the Struts components. |
| |
| servlet.jar The servlet jar (either 2.2 or 2.3) |
| |
| cactus.home The home directory of your Cactus |
| installation (version 1.3+ required) |
| |
| cactus.contextScheme The scheme used for testing, ie https, http |
| |
| |
| cactus.contextHost The hostname used for testing, ie localhost, www.apache.org, etc. |
| |
| |
| cactus.contextPort The Port used for testing |
| |
| |
| cactus.contextApp The application(context) being tested, ie test |
| |
| |
| aspectjrt.jar The AspectJ runtime jar that is |
| included with Cactus 1.3 |
| |
| cactus.jar The Cactus jar (either for Servlet API |
| 2.2 or 2.3). |
| |
| cactus.ant.jar The Cactus custom Ant tasks jar |
| |
| junit.jar The JUnit jar |
| |
| tomcat.home.32 The home directory of where Tomcat 3.2 |
| is installed |
| |
| tomcat.home.40 The home directory of where Tomcat 4.0 |
| is installed |
| |
| tomcat.home.41 The home directory of where Tomcat 4.1 |
| is installed |
| |
| compile.debug The debug mode for compilation |
| |
| compile.deprecation The deprecation mode for compilation |
| |
| compile.optimize The optimization mode for compilation |
| |
| src.dir The location of the source directory |
| |
| app.name The name of the Struts jar (without the |
| '.jar' suffix |
| |
| --> |
| |
| <!-- ========== Initialization Properties ================================= --> |
| |
| <!-- |
| These property values may optionally be overridden with property |
| settings from an "ant" command line, the "build.properties" file |
| in this directory, the "build.properties" file in your home |
| directory, or from settings in a superior build.xml script. |
| --> |
| |
| |
| <!-- ========== Derived Properties ======================================== --> |
| |
| <!-- |
| These property values are derived from values defined above, and |
| generally should NOT be overridden by command line settings |
| --> |
| |
| <!-- Source directory for tests --> |
| <property name="src.test.dir" value="${src.dir}/test"/> |
| |
| <!-- Configuration directory for tests --> |
| <property name="conf.test.dir" value="conf/test"/> |
| |
| <!-- Output directory for tests --> |
| <property name="out.test.dir" value="${build.home}/test"/> |
| |
| <!-- cactus lib --> |
| <property name="cactus.lib" value="${cactus.home}/lib"/> |
| |
| <!-- Default Cactus Context Scheme --> |
| <property name="cactus.contextScheme" value="http" /> |
| |
| <!-- Default Cactus Context Host --> |
| <property name="cactus.contextHost" value="localhost" /> |
| |
| <!-- Default Cactus Context Port --> |
| <property name="cactus.contextPort" value="8080" /> |
| |
| <!-- Default Cactus Context Application --> |
| <property name="cactus.contextApp" value="test" /> |
| |
| <!-- Context test is taking place on --> |
| <property name="cactus.contextURL" value="${cactus.contextScheme}://${cactus.contextHost}:${cactus.contextPort}/${cactus.contextApp}"/> |
| |
| <!-- This is only used if you execute "ant download-dependencies" --> |
| <property name="libdir" value="lib" /> |
| |
| <!-- Cactus Test Runner --> |
| <property name="cactus.servertest.class" value="org.apache.cactus.integration.ant.RunServerTestsTask" /> |
| |
| <!-- Cactus jspRedirector.jsp --> |
| <!-- N.B. The one in cactus home works except for cactus 1.3 (because session="false") --> |
| <property name="cactus.jspRedirector" value="${cactus.home}/web/jspRedirector.jsp" /> |
| |
| <path id="downloaded.lib.classpath"> |
| <fileset dir="${libdir}"> |
| <include name="*.jar"/> |
| </fileset> |
| </path> |
| |
| <path id="cactus.ant.classpath"> |
| <fileset dir="${cactus.lib}"> |
| <include name="cactus-ant*.jar"/> |
| </fileset> |
| </path> |
| |
| |
| <path id="cactus.lib.classpath"> |
| <fileset dir="${cactus.lib}"> |
| <include name="cactus*.jar"/> |
| <exclude name="cactus-ant*.jar"/> |
| <include name="aspectjrt*.jar"/> |
| <include name="httpunit*.jar"/> |
| <include name="commons-httpclient*.jar"/> |
| </fileset> |
| </path> |
| |
| <!-- Compilation Classpath --> |
| <path id="compile.classpath"> |
| <pathelement location="${build.home}/library/${app.name}.jar"/> |
| <pathelement location="${build.home}/test/classes"/> |
| <pathelement location="${commons-beanutils.jar}"/> |
| <pathelement location="${commons-digester.jar}"/> |
| <pathelement location="${commons-fileupload.jar}"/> |
| <pathelement location="${commons-logging.jar}"/> |
| <pathelement location="${commons-validator.jar}"/> |
| <pathelement location="${jakarta-oro.jar}"/> |
| <pathelement location="${junit.jar}"/> |
| <pathelement location="${servlet.jar}"/> |
| <pathelement location="${struts.jar}"/> |
| <pathelement location="${antlr.jar}"/> |
| <pathelement location="${xerces.jar}"/> |
| |
| <!-- cactus lib jars --> |
| <path refid="cactus.lib.classpath"/> |
| |
| <!-- this is harmless if not used --> |
| <path refid="downloaded.lib.classpath"/> |
| |
| </path> |
| |
| <!-- ========== Executable Targets ======================================== --> |
| |
| |
| <!-- |
| Initialization of custom Ant tasks |
| --> |
| <target name="init"> |
| |
| <taskdef name="runservertests" |
| classname="${cactus.servertest.class}"> |
| |
| <classpath> |
| <path refid="cactus.ant.classpath"/> |
| <pathelement path="${java.class.path}"/> |
| </classpath> |
| </taskdef> |
| |
| </target> |
| |
| <!-- |
| Create directories and copy files for the struts tests |
| --> |
| <target name="prepare.test" depends="init"> |
| |
| <!-- Create target directories for classes --> |
| <mkdir dir="${out.test.dir}/classes"/> |
| |
| <!-- Create directory where servlet engines will run --> |
| <mkdir dir="${out.test.dir}/servers"/> |
| |
| <!-- Create directory where servlet engines will run --> |
| <mkdir dir="${out.test.dir}/WEB-INF"/> |
| |
| <!-- Create a lib directory where needed libs for the test war will |
| be put --> |
| <mkdir dir="${out.test.dir}/lib"/> |
| |
| </target> |
| |
| <!-- |
| Compile unit tests |
| --> |
| <target name="compile.test" depends="prepare.test"> |
| |
| <javac srcdir="${src.test.dir}" |
| destdir="${out.test.dir}/classes" |
| debug="${compile.debug}" |
| optimize="${compile.optimize}" |
| deprecation="${compile.deprecation}"> |
| |
| <classpath refid="compile.classpath"/> |
| </javac> |
| <copy todir="${out.test.dir}/classes"> |
| <fileset dir="${src.test.dir}" excludes="**/*.java"/> |
| </copy> |
| <filter token="cactus.contextURL" value="${cactus.contextURL}"/> |
| <copy todir="${out.test.dir}/classes" filtering="on"> |
| <fileset dir="${conf.test.dir}" includes="*.properties"/> |
| </copy> |
| <copy todir="${out.test.dir}/WEB-INF"> |
| <fileset dir="${build.home}/library" includes="struts-*.tld"/> |
| </copy> |
| <copy todir="${out.test.dir}/WEB-INF"> |
| <fileset dir="${conf.test.dir}" includes="struts-config.xml"/> |
| </copy> |
| |
| </target> |
| |
| <!-- |
| Prepare test war (for all servlet engines) |
| --> |
| <target name="prepare.test.war" depends="compile.test"> |
| |
| <!-- Copy needed libs in /lib --> |
| <copy file="${build.home}/library/${app.name}.jar" |
| todir="${out.test.dir}/lib"/> |
| <copy file="${junit.jar}" todir="${out.test.dir}/lib"/> |
| <copy file="${jakarta-oro.jar}" todir="${out.test.dir}/lib"/> |
| <copy file="${commons-beanutils.jar}" |
| todir="${out.test.dir}/lib"/> |
| <copy file="${commons-digester.jar}" |
| todir="${out.test.dir}/lib"/> |
| <copy file="${commons-logging.jar}" |
| todir="${out.test.dir}/lib"/> |
| <copy file="${commons-validator.jar}" |
| todir="${out.test.dir}/lib"/> |
| |
| <!-- copy cactus jars --> |
| <copy todir="${out.test.dir}/lib"> |
| <fileset dir="${cactus.lib}"> |
| <include name="cactus*.jar"/> |
| <exclude name="cactus-ant*.jar"/> |
| <include name="aspectjrt*.jar"/> |
| <include name="httpunit*.jar"/> |
| <include name="log4j*.jar"/> |
| </fileset> |
| </copy> |
| |
| <war warfile="${out.test.dir}/test.war" |
| webxml="${conf.test.dir}/web.xml"> |
| |
| <!-- copy JspRedirector.jsp --> |
| <fileset file="${cactus.jspRedirector}"/> |
| |
| <!-- copy jsps (except JspRedirector.jsp) --> |
| <fileset dir="${web.dir}/test" > |
| <exclude name="jspRedirector.jsp" /> |
| </fileset> |
| |
| <classes dir="${out.test.dir}/classes"/> |
| |
| <!-- We need to copy the Cactus, JUnit and Struts jars in the war. |
| This is because if we just put these jars in the global |
| classpath for the Servlet engine, the Cactus jar might not be |
| able to load the test case class as the test classes are loaded |
| by the war classloader. This will depend on servlet engines --> |
| |
| <lib dir="${out.test.dir}/lib"/> |
| |
| <webinf dir="${out.test.dir}/WEB-INF" includes="**/*.*"/> |
| |
| </war> |
| |
| </target> |
| |
| <!-- |
| Start the Cactus test using JUnit test runner. |
| --> |
| <target name="run.test"> |
| |
| <junit printsummary="yes" haltonfailure="yes" haltonerror="yes" fork="yes"> |
| |
| <classpath> |
| <pathelement path="${java.class.path}"/> |
| <pathelement location="${commons-httpclient.jar}"/> |
| <pathelement location="${out.test.dir}/classes"/> |
| <!-- For cactus.properties --> |
| <pathelement location="${conf.test.dir}"/> |
| </classpath> |
| <classpath refid="compile.classpath"/> |
| |
| <formatter type="plain" usefile="false"/> |
| |
| <!-- org.apache.struts.action package Tests --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/action/Test*.class" /> |
| </fileset> |
| </batchtest> |
| |
| <!-- Logic Taglib Tests --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/taglib/logic/Test*.class" /> |
| </fileset> |
| </batchtest> |
| |
| <!-- Bean Taglib Tests --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/taglib/bean/Test*.class" /> |
| </fileset> |
| </batchtest> |
| |
| <!-- Html Taglib Tests --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/taglib/html/Test*.class" /> |
| </fileset> |
| </batchtest> |
| |
| <!-- org.apache.struts.util package Tests --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/util/Test*.class" /> |
| </fileset> |
| </batchtest> |
| |
| <!-- org.apache.struts.util package Tests --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/tiles/Test*.class" /> |
| </fileset> |
| </batchtest> |
| |
| </junit> |
| |
| </target> |
| |
| <!-- |
| Prepare test directory structure for Tomcat 3.2 servlet engine |
| --> |
| <target name="prepare.test.tomcat.32" depends="prepare.test.war" if="tomcat.home.32"> |
| |
| <property name="out.tomcat.32.dir" value="${out.test.dir}/servers/tomcat32"/> |
| <filter token="out.tomcat.32.dir" value="${out.tomcat.32.dir}"/> |
| <filter token="tomcat.connector.port" value="${cactus.contextPort}"/> |
| |
| <mkdir dir="${out.tomcat.32.dir}/webapps"/> |
| <mkdir dir="${out.tomcat.32.dir}/conf"/> |
| |
| <!-- Delete old directory so new war is unzipped --> |
| <delete dir="${out.tomcat.32.dir}/webapps/test"/> |
| |
| <!-- Copy war file --> |
| <copy file="${out.test.dir}/test.war" todir="${out.tomcat.32.dir}/webapps"/> |
| |
| <!-- Copy configuration files --> |
| <copy file="${conf.test.dir}/tomcat32/server.xml" |
| todir="${out.tomcat.32.dir}/conf" filtering="on"/> |
| |
| </target> |
| |
| <!-- |
| Run unit tests on Tomcat 3.2 servlet engine |
| --> |
| <target name="test.tomcat.32" depends="prepare.test.tomcat.32"> |
| |
| <!-- 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.32" |
| stopTarget="stop.tomcat.32" |
| testTarget="run.test"/> |
| |
| </target> |
| |
| <!-- |
| Start Tomcat 3.2 servlet engine |
| --> |
| <target name="start.tomcat.32"> |
| |
| <java classname="org.apache.tomcat.startup.Tomcat" fork="yes"> |
| <arg value="-config"/> |
| <arg value="${out.tomcat.32.dir}/conf/server.xml"/> |
| <classpath> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| <fileset dir="${tomcat.home.32}/lib"> |
| <include name="*.jar"/> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Stop Tomcat 3.2 servlet engine |
| --> |
| <target name="stop.tomcat.32"> |
| |
| <java classname="org.apache.tomcat.startup.Tomcat" fork="yes"> |
| <jvmarg value="-Dtomcat.home=${tomcat.home.32}"/> |
| <arg value="-stop"/> |
| <classpath> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| <fileset dir="${tomcat.home.32}/lib"> |
| <include name="*.jar"/> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Prepare test directory structure for Tomcat 3.3 servlet engine |
| --> |
| <target name="prepare.test.tomcat.33" depends="prepare.test.war" if="tomcat.home.33"> |
| |
| <property name="out.tomcat.33.dir" value="${out.test.dir}/servers/tomcat33"/> |
| <filter token="out.tomcat.33.dir" value="${out.tomcat.33.dir}"/> |
| <filter token="tomcat.connector.port" value="${cactus.contextPort}"/> |
| |
| <mkdir dir="${out.tomcat.33.dir}/webapps"/> |
| <mkdir dir="${out.tomcat.33.dir}/conf"/> |
| |
| <!-- Delete old directory so new war is unzipped --> |
| <delete dir="${out.tomcat.33.dir}/webapps/test"/> |
| |
| <!-- Copy war file --> |
| <copy file="${out.test.dir}/test.war" todir="${out.tomcat.33.dir}/webapps"/> |
| |
| <!-- Copy configuration files --> |
| <copy file="${conf.test.dir}/tomcat33/server.xml" |
| todir="${out.tomcat.33.dir}/conf" filtering="on"/> |
| <copy file="${conf.test.dir}/tomcat33/modules.xml" |
| todir="${out.tomcat.33.dir}/conf" filtering="on"/> |
| |
| </target> |
| |
| <!-- |
| Run unit tests on Tomcat 3.3 servlet engine |
| --> |
| <target name="test.tomcat.33" depends="prepare.test.tomcat.33"> |
| |
| <!-- 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.33" |
| stopTarget="stop.tomcat.33" |
| testTarget="run.test"/> |
| |
| </target> |
| |
| <!-- |
| Start Tomcat 3.3 servlet engine |
| --> |
| <target name="start.tomcat.33"> |
| |
| <java classname="org.apache.tomcat.startup.Main" fork="yes"> |
| <arg value="-home"/> |
| <arg value="${out.tomcat.33.dir}"/> |
| <arg value="-config"/> |
| <arg value="${out.tomcat.33.dir}/conf/server.xml"/> |
| <arg value="run"/> |
| <classpath> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| <fileset dir="${tomcat.home.33}/lib"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="${tomcat.home.33}/lib/common"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="${tomcat.home.33}/lib/container"> |
| <include name="*.jar"/> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Stop Tomcat 3.3 servlet engine |
| --> |
| <target name="stop.tomcat.33"> |
| |
| <java classname="org.apache.tomcat.startup.Main" fork="yes"> |
| <jvmarg value="-Dtomcat.home=${out.tomcat.33.dir}"/> |
| <arg value="stop"/> |
| <classpath> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| <fileset dir="${tomcat.home.33}/lib"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="${tomcat.home.33}/lib/common"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="${tomcat.home.33}/lib/container"> |
| <include name="*.jar"/> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Prepare test directory structure for Tomcat 4.0 servlet engine |
| --> |
| <target name="prepare.test.tomcat.40" depends="prepare.test.war" if="tomcat.home.40"> |
| |
| <property name="out.tomcat.40.dir" value="${out.test.dir}/servers/tomcat40"/> |
| <filter token="out.tomcat.40.full.dir" value="${out.tomcat.40.dir}"/> |
| <filter token="tomcat.connector.port" value="${cactus.contextPort}"/> |
| |
| <mkdir dir="${out.tomcat.40.dir}/webapps"/> |
| <mkdir dir="${out.tomcat.40.dir}/conf"/> |
| |
| <!-- Delete old directory so new war is unzipped --> |
| <delete dir="${out.tomcat.40.dir}/webapps/test"/> |
| |
| <!-- Copy war file --> |
| <copy file="${out.test.dir}/test.war" todir="${out.tomcat.40.dir}/webapps"/> |
| |
| <!-- Copy configuration files --> |
| <copy file="${conf.test.dir}/tomcat40/server.xml" |
| todir="${out.tomcat.40.dir}/conf" filtering="on"/> |
| |
| </target> |
| |
| <!-- |
| Run unit tests on Tomcat 4.0 servlet engine |
| --> |
| <target name="test.tomcat.40" depends="prepare.test.tomcat.40"> |
| |
| <!-- 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.40" |
| stopTarget="stop.tomcat.40" |
| testTarget="run.test"/> |
| |
| </target> |
| |
| <!-- |
| Start Tomcat 4.0 servlet engine |
| --> |
| <target name="start.tomcat.40"> |
| |
| <java classname="org.apache.catalina.startup.Bootstrap" fork="yes"> |
| <jvmarg value="-Dcatalina.home=${tomcat.home.40}"/> |
| <jvmarg value="-Dcatalina.base=${tomcat.home.40}"/> |
| <arg value="-config"/> |
| <arg value="${out.tomcat.40.dir}/conf/server.xml"/> |
| <arg value="start"/> |
| <classpath> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| <fileset dir="${tomcat.home.40}"> |
| <include name="bin/bootstrap.jar"/> |
| <!-- <include name="server/catalina.jar"/> --> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Stop Tomcat 4.0 servlet engine |
| --> |
| <target name="stop.tomcat.40"> |
| |
| <java classname="org.apache.catalina.startup.Bootstrap" fork="yes"> |
| <jvmarg value="-Dcatalina.home=${tomcat.home.40}"/> |
| <jvmarg value="-Dcatalina.base=${tomcat.home.40}"/> |
| <arg value="-config"/> |
| <arg value="${out.tomcat.40.dir}/conf/server.xml"/> |
| <arg value="stop"/> |
| <classpath> |
| <fileset dir="${tomcat.home.40}"> |
| <include name="bin/bootstrap.jar"/> |
| <!-- <include name="server/catalina.jar"/> --> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Prepare test directory structure for Tomcat 4.1 servlet engine |
| --> |
| <target name="prepare.test.tomcat.41" depends="prepare.test.war" if="tomcat.home.41"> |
| |
| <property name="out.tomcat.41.dir" value="${out.test.dir}/servers/tomcat41"/> |
| <filter token="out.tomcat.41.full.dir" value="${out.tomcat.41.dir}"/> |
| <filter token="tomcat.connector.port" value="${cactus.contextPort}"/> |
| |
| <mkdir dir="${out.tomcat.41.dir}/webapps"/> |
| <mkdir dir="${out.tomcat.41.dir}/conf"/> |
| |
| <!-- Delete old directory so new war is unzipped --> |
| <delete dir="${out.tomcat.41.dir}/webapps/test"/> |
| |
| <!-- Copy war file --> |
| <copy file="${out.test.dir}/test.war" todir="${out.tomcat.41.dir}/webapps"/> |
| |
| <!-- Copy configuration files --> |
| <copy file="${conf.test.dir}/tomcat41/server.xml" |
| todir="${out.tomcat.41.dir}/conf" filtering="on"/> |
| |
| </target> |
| |
| <!-- |
| Run unit tests on Tomcat 4.1 servlet engine |
| --> |
| <target name="test.tomcat.41" depends="prepare.test.tomcat.41"> |
| |
| <!-- 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.41" |
| stopTarget="stop.tomcat.41" |
| testTarget="run.test"/> |
| |
| </target> |
| |
| <!-- |
| Start Tomcat 4.1 servlet engine |
| --> |
| <target name="start.tomcat.41"> |
| |
| <java classname="org.apache.catalina.startup.Bootstrap" fork="yes"> |
| <jvmarg value="-Dcatalina.home=${tomcat.home.41}"/> |
| <jvmarg value="-Dcatalina.base=${tomcat.home.41}"/> |
| <arg value="-config"/> |
| <arg value="${out.tomcat.41.dir}/conf/server.xml"/> |
| <arg value="start"/> |
| <classpath> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| <fileset dir="${tomcat.home.41}"> |
| <include name="bin/bootstrap.jar"/> |
| <!-- <include name="server/catalina.jar"/> --> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- |
| Stop Tomcat 4.1 servlet engine |
| --> |
| <target name="stop.tomcat.41"> |
| |
| <java classname="org.apache.catalina.startup.Bootstrap" fork="yes"> |
| <jvmarg value="-Dcatalina.home=${tomcat.home.41}"/> |
| <jvmarg value="-Dcatalina.base=${tomcat.home.41}"/> |
| <arg value="-config"/> |
| <arg value="${out.tomcat.41.dir}/conf/server.xml"/> |
| <arg value="stop"/> |
| <classpath> |
| <fileset dir="${tomcat.home.41}"> |
| <include name="bin/bootstrap.jar"/> |
| <!-- <include name="server/catalina.jar"/> --> |
| </fileset> |
| </classpath> |
| </java> |
| |
| </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 ======================== --> |
| |
| |
| <target name="test.junit" depends="compile.test" |
| description="Run all non-Cactus based JUnit tests"> |
| |
| <junit printsummary="yes" haltonfailure="no" haltonerror="no" fork="yes"> |
| |
| <!-- JUnit Configuration Options --> |
| <classpath refid="compile.classpath"/> |
| <formatter type="plain" usefile="false"/> |
| |
| <!-- Tests for org.apache.struts.action --> |
| <test name="org.apache.struts.action.TestDynaActionForm"/> |
| <test name="org.apache.struts.action.TestDynaActionFormClass"/> |
| <test name="org.apache.struts.config.TestModuleConfig"/> |
| <test name="org.apache.struts.config.TestActionConfigMatcher"/> |
| <test name="org.apache.struts.tiles.TestTilesPlugin"/> |
| |
| <!-- Tests for org.apache.struts.validator --> |
| <test name="org.apache.struts.validator.TestValidWhen"/> |
| |
| <!-- Tests for org.apache.struts.util --> |
| <batchtest fork="yes"> |
| <fileset dir="${out.test.dir}/classes"> |
| <include name="org/apache/struts/util/Test*.class"/> |
| </fileset> |
| </batchtest> |
| |
| <!-- Tests for org.apache.struts.taglib.TagUtils --> |
| <test name="org.apache.struts.taglib.TestTagUtils"/> |
| |
| </junit> |
| |
| </target> |
| |
| |
| </project> |