2004-03-16 23:57:17 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
Build file for running container integration tests.
|
2004-03-24 18:35:06 +00:00
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
$Id$
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<project name="acegi-security-integration-tests" default="usage" basedir=".">
|
|
|
|
|
|
|
|
|
|
<property file="build.properties"/>
|
|
|
|
|
<property file="project.properties"/>
|
|
|
|
|
|
|
|
|
|
<path id="qa-portalpath">
|
|
|
|
|
<fileset dir="${dist.lib.dir}">
|
|
|
|
|
<include name="acegi-security-spring.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
<fileset dir="${lib.dir}">
|
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
<fileset dir="${httpunit.lib.dir}">
|
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</path>
|
|
|
|
|
|
|
|
|
|
<path id="jalopy-classpath">
|
|
|
|
|
<fileset dir="${lib.dir}/jalopy">
|
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</path>
|
|
|
|
|
|
|
|
|
|
<target name="usage">
|
|
|
|
|
<echo message=""/>
|
|
|
|
|
<echo message="${name} build file"/>
|
|
|
|
|
<echo message="------------------------------------------------------"/>
|
|
|
|
|
<echo message=""/>
|
|
|
|
|
<echo message="Among the available targets are:"/>
|
|
|
|
|
<echo message=""/>
|
|
|
|
|
<echo message="clean --> deletes output directories"/>
|
|
|
|
|
<echo message="unzip --> unzips each container into file system"/>
|
|
|
|
|
<echo message="tests --> unzips each container and runs all tests"/>
|
|
|
|
|
<echo message="tests-jetty --> runs the integration tests with Jetty"/>
|
|
|
|
|
<echo message="tests-jboss --> runs the integration tests with JBoss"/>
|
|
|
|
|
<echo message="tests-catalina --> runs the integration tests with Catalina"/>
|
|
|
|
|
<echo message=""/>
|
|
|
|
|
<echo message="Each tests-xxxx target assumes the container is unzipped"/>
|
|
|
|
|
<echo message=""/>
|
|
|
|
|
<echo message="BE SURE TO CHECK REPORTS DIRECTORY FOR RESULTS OF TESTS!"/>
|
|
|
|
|
<echo message=" *** The script does NOT halt if a test fails ***"/>
|
|
|
|
|
<echo message=""/>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="clean" description="Clean all output dirs">
|
|
|
|
|
<delete dir="${build.dir}"/>
|
|
|
|
|
<delete dir="${tmp.dir}"/>
|
|
|
|
|
<delete dir="${reports.dir}"/>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="buildtests" depends="" description="Compile test source tree Java files into class files">
|
|
|
|
|
<mkdir dir="${build.dir}"/>
|
|
|
|
|
|
|
|
|
|
<javac destdir="${build.dir}" target="1.3" debug="${debug}"
|
|
|
|
|
deprecation="false" optimize="false" failonerror="true">
|
|
|
|
|
<src path="${src.dir}"/>
|
|
|
|
|
<classpath refid="qa-portalpath"/>
|
|
|
|
|
</javac>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="format" description="Formats all project source code">
|
|
|
|
|
<taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
|
|
|
|
|
<classpath refid="jalopy-classpath"/>
|
|
|
|
|
</taskdef>
|
|
|
|
|
|
|
|
|
|
<jalopy fileformat="unix"
|
|
|
|
|
convention="${jalopy.xml}"
|
|
|
|
|
history="file"
|
|
|
|
|
historymethod="adler32"
|
|
|
|
|
loglevel="error"
|
|
|
|
|
threads="2"
|
|
|
|
|
classpathref="qa-portalpath">
|
|
|
|
|
<fileset dir="${src.dir}">
|
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</jalopy>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="tests" depends="clean,unzip,tests-jetty,tests-catalina,tests-jboss" description="Run all integration tests">
|
|
|
|
|
<echo message="BE SURE TO CHECK REPORTS DIRECTORY FOR RESULTS OF TESTS!"/>
|
|
|
|
|
</target>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
<target name="tests-jetty" depends="buildtests" description="Runs Jetty integration tests">
|
2004-03-24 18:35:06 +00:00
|
|
|
<copy file="${config.dir}/jetty-${jetty.version}/jetty.xml" todir="${tmp.dir}/jetty-${jetty.version}/etc" overwrite="true"/>
|
|
|
|
|
<copy file="${acegisecurity.xml}" todir="${tmp.dir}/jetty-${jetty.version}/etc" overwrite="true"/>
|
|
|
|
|
<copy file="${dist.lib.dir}/acegi-security-jetty-ext.jar" todir="${tmp.dir}/jetty-${jetty.version}/ext" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/aop-alliance/aopalliance.jar" todir="${tmp.dir}/jetty-${jetty.version}/ext" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/jakarta-commons/commons-logging.jar" todir="${tmp.dir}/jetty-${jetty.version}/ext" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/spring/spring.jar" todir="${tmp.dir}/jetty-${jetty.version}/ext" overwrite="true"/>
|
|
|
|
|
<copy file="${contacts.war}" todir="${tmp.dir}/jetty-${jetty.version}/webapps" overwrite="true"/>
|
|
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
<parallel>
|
2004-03-24 18:35:06 +00:00
|
|
|
<java fork="true" dir="${tmp.dir}/jetty-${jetty.version}/" classpath="${tmp.dir}/jetty-${jetty.version}/start.jar" classname="org.mortbay.start.Main">
|
2004-03-16 23:57:17 +00:00
|
|
|
</java>
|
|
|
|
|
<sequential>
|
2004-03-24 18:35:06 +00:00
|
|
|
<waitfor maxwait="240" maxwaitunit="second" checkevery="500" checkeveryunit="millisecond">
|
2004-03-16 23:57:17 +00:00
|
|
|
<http url="http://localhost:8080/contacts" />
|
|
|
|
|
</waitfor>
|
2004-03-24 18:35:06 +00:00
|
|
|
<delete dir="${reports.dir}/jetty-${jetty.version}"/>
|
|
|
|
|
<mkdir dir="${reports.dir}/jetty-${jetty.version}"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
<junit printsummary="yes" haltonfailure="no">
|
|
|
|
|
<classpath location="${build.dir}"/>
|
|
|
|
|
<classpath refid="qa-portalpath"/>
|
2004-03-24 18:35:06 +00:00
|
|
|
<formatter type="xml"/>
|
|
|
|
|
<batchtest fork="yes" todir="${reports.dir}/jetty-${jetty.version}">
|
2004-03-16 23:57:17 +00:00
|
|
|
<fileset dir="${build.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
|
|
|
|
|
</batchtest>
|
|
|
|
|
</junit>
|
2004-03-24 18:35:06 +00:00
|
|
|
<java fork="true" dir="${tmp.dir}/jetty-${jetty.version}/" classpath="${tmp.dir}/jetty-${jetty.version}/stop.jar" classname="org.mortbay.stop.Main"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
</sequential>
|
|
|
|
|
</parallel>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
|
|
|
|
<antcall target="-report">
|
|
|
|
|
<param name="product" value="jetty-${jetty.version}"/>
|
|
|
|
|
</antcall>
|
2004-03-16 23:57:17 +00:00
|
|
|
</target>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
|
|
|
|
<target name="tests-catalina" description="Runs Catalina integration tests">
|
|
|
|
|
<antcall target="-tests-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-4.1.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
<antcall target="-tests-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-5.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="tests-catalina-4.1" description="Runs Catalina 4.1 integration tests">
|
|
|
|
|
<antcall target="-tests-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-4.1.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="tests-catalina-5" description="Runs Catalina 5 integration tests">
|
|
|
|
|
<antcall target="-tests-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-5.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="-tests-catalina" depends="buildtests" description="Runs Catalina integration tests">
|
|
|
|
|
<delete dir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/webapps/contacts"/>
|
|
|
|
|
<copy file="${config.dir}/catalina-${tomcat.version}/server.xml" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/conf" overwrite="true"/>
|
|
|
|
|
<copy file="${acegisecurity.xml}" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/conf" overwrite="true"/>
|
|
|
|
|
<copy file="${dist.lib.dir}/acegi-security-catalina-server.jar" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/server/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${dist.lib.dir}/acegi-security-catalina-common.jar" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/common/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/aop-alliance/aopalliance.jar" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/common/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/spring/spring.jar" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/common/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${contacts.war}" todir="${tmp.dir}/jakarta-tomcat-${tomcat.version}/webapps" overwrite="true"/>
|
|
|
|
|
|
|
|
|
|
<property name="tomcat.home" value="${tmp.dir}/jakarta-tomcat-${tomcat.version}"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
<parallel>
|
|
|
|
|
<java fork="true" classname="org.apache.catalina.startup.Bootstrap" dir="${tomcat.home}">
|
|
|
|
|
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
|
|
|
|
|
<arg value="start"/>
|
|
|
|
|
<classpath>
|
|
|
|
|
<pathelement path="${java.home}/../lib/tools.jar"/>
|
|
|
|
|
<fileset dir="${tomcat.home}">
|
|
|
|
|
<include name="bin/bootstrap.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</classpath>
|
|
|
|
|
</java>
|
|
|
|
|
<sequential>
|
2004-03-24 18:35:06 +00:00
|
|
|
<waitfor maxwait="240" maxwaitunit="second" checkevery="500" checkeveryunit="millisecond">
|
2004-03-16 23:57:17 +00:00
|
|
|
<http url="http://localhost:8080/contacts" />
|
|
|
|
|
</waitfor>
|
2004-03-24 18:35:06 +00:00
|
|
|
<delete dir="${reports.dir}/jakarta-tomcat-${tomcat.version}"/>
|
|
|
|
|
<mkdir dir="${reports.dir}/jakarta-tomcat-${tomcat.version}"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
<junit printsummary="yes" haltonfailure="no">
|
|
|
|
|
<classpath location="${build.dir}"/>
|
|
|
|
|
<classpath refid="qa-portalpath"/>
|
2004-03-24 18:35:06 +00:00
|
|
|
<formatter type="xml"/>
|
|
|
|
|
<batchtest fork="yes" todir="${reports.dir}/jakarta-tomcat-${tomcat.version}">
|
2004-03-16 23:57:17 +00:00
|
|
|
<fileset dir="${build.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
|
|
|
|
|
</batchtest>
|
|
|
|
|
</junit>
|
|
|
|
|
<java fork="true" classname="org.apache.catalina.startup.Bootstrap" dir="${tomcat.home}">
|
|
|
|
|
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
|
|
|
|
|
<arg value="stop"/>
|
|
|
|
|
<classpath>
|
|
|
|
|
<pathelement path="${java.home}/../lib/tools.jar"/>
|
|
|
|
|
<fileset dir="${tomcat.home}">
|
|
|
|
|
<include name="bin/bootstrap.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</classpath>
|
|
|
|
|
</java>
|
|
|
|
|
</sequential>
|
|
|
|
|
</parallel>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
|
|
|
|
<antcall target="-report">
|
|
|
|
|
<param name="product" value="jakarta-tomcat-${tomcat.version}"/>
|
|
|
|
|
</antcall>
|
2004-03-16 23:57:17 +00:00
|
|
|
</target>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
<target name="tests-jboss" depends="buildtests" description="Runs JBoss integration tests">
|
2004-03-24 18:35:06 +00:00
|
|
|
<copy file="${config.dir}/jboss-${jboss.version}/login-config.xml" todir="${tmp.dir}/jboss-${jboss.version}/server/default/conf" overwrite="true"/>
|
|
|
|
|
<copy file="${acegisecurity.xml}" todir="${tmp.dir}/jboss-${jboss.version}/server/default/conf" overwrite="true"/>
|
|
|
|
|
<copy file="${dist.lib.dir}/acegi-security-jboss-lib.jar" todir="${tmp.dir}/jboss-${jboss.version}/server/default/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/aop-alliance/aopalliance.jar" todir="${tmp.dir}/jboss-${jboss.version}/server/default/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${lib.dir}/spring/spring.jar" todir="${tmp.dir}/jboss-${jboss.version}/server/default/lib" overwrite="true"/>
|
|
|
|
|
<copy file="${contacts.war}" todir="${tmp.dir}/jboss-${jboss.version}/server/default/deploy" overwrite="true"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
|
|
|
|
|
<parallel>
|
2004-03-24 18:35:06 +00:00
|
|
|
<java fork="yes" classname="org.jboss.Main" dir="${tmp.dir}/jboss-${jboss.version}">
|
2004-03-16 23:57:17 +00:00
|
|
|
<classpath>
|
|
|
|
|
<pathelement path="${java.home}/../lib/tools.jar"/>
|
2004-03-24 18:35:06 +00:00
|
|
|
<pathelement path="${tmp.dir}/jboss-${jboss.version}/bin/run.jar"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
</classpath>
|
|
|
|
|
</java>
|
|
|
|
|
<sequential>
|
2004-03-24 18:35:06 +00:00
|
|
|
<waitfor maxwait="240" maxwaitunit="second" checkevery="500" checkeveryunit="millisecond">
|
2004-03-16 23:57:17 +00:00
|
|
|
<http url="http://localhost:8080/contacts" />
|
|
|
|
|
</waitfor>
|
2004-03-24 18:35:06 +00:00
|
|
|
<delete dir="${reports.dir}/jboss-${jboss.version}"/>
|
|
|
|
|
<mkdir dir="${reports.dir}/jboss-${jboss.version}"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
<junit printsummary="yes" haltonfailure="no">
|
|
|
|
|
<classpath location="${build.dir}"/>
|
|
|
|
|
<classpath refid="qa-portalpath"/>
|
2004-03-24 18:35:06 +00:00
|
|
|
<formatter type="xml"/>
|
|
|
|
|
<batchtest fork="yes" todir="${reports.dir}/jboss-${jboss.version}">
|
2004-03-16 23:57:17 +00:00
|
|
|
<fileset dir="${build.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
|
|
|
|
|
</batchtest>
|
|
|
|
|
</junit>
|
2004-03-24 18:35:06 +00:00
|
|
|
<java fork="yes" classname="org.jboss.Shutdown" dir="${tmp.dir}/jboss-${jboss.version}">
|
2004-03-16 23:57:17 +00:00
|
|
|
<arg value="--shutdown"/>
|
|
|
|
|
<classpath>
|
2004-03-24 18:35:06 +00:00
|
|
|
<pathelement path="${tmp.dir}/jboss-${jboss.version}/bin/shutdown.jar"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
</classpath>
|
|
|
|
|
</java>
|
|
|
|
|
</sequential>
|
|
|
|
|
</parallel>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
|
|
|
|
<antcall target="-report">
|
|
|
|
|
<param name="product" value="jboss-${jboss.version}"/>
|
|
|
|
|
</antcall>
|
2004-03-16 23:57:17 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="unzip" depends="unzip-jetty,unzip-catalina,unzip-jboss" description="Unzip all containers"/>
|
|
|
|
|
|
|
|
|
|
<target name="unzip-jetty" depends="" description="Unzip Jetty container">
|
2004-03-24 18:35:06 +00:00
|
|
|
<delete dir="${tmp.dir}/Jetty-${jetty.version}"/>
|
|
|
|
|
<mkdir dir="${tmp.dir}/Jetty-${jetty.version}"/>
|
|
|
|
|
<unzip src="${containers.dir}/Jetty-${jetty.version}-all.zip" dest="${tmp.dir}"/>
|
2004-03-16 23:57:17 +00:00
|
|
|
</target>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
<target name="unzip-catalina" depends="" description="Unzip Catalina container">
|
2004-03-24 18:35:06 +00:00
|
|
|
<antcall target="-unzip-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-4.1.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
<antcall target="-unzip-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-5.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="unzip-catalina-4.1" depends="" description="Unzip Catalina 4.1 container">
|
|
|
|
|
<antcall target="-unzip-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-4.1.version}"/>
|
|
|
|
|
</antcall>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="unzip-catalina-5" depends="" description="Unzip Catalina 5 container">
|
|
|
|
|
<antcall target="-unzip-catalina">
|
|
|
|
|
<param name="tomcat.version" value="${tomcat-4.1.version}"/>
|
|
|
|
|
</antcall>
|
2004-03-16 23:57:17 +00:00
|
|
|
</target>
|
2004-03-24 18:35:06 +00:00
|
|
|
|
|
|
|
|
<target name="-unzip-catalina" depends="" description="Unzip Catalina container">
|
|
|
|
|
<delete dir="${tmp.dir}/jakarta-tomcat-${tomcat.version}"/>
|
|
|
|
|
<mkdir dir="${tmp.dir}/jakarta-tomcat-${tomcat.version}"/>
|
|
|
|
|
<unzip src="${containers.dir}/jakarta-tomcat-${tomcat.version}.zip" dest="${tmp.dir}"/>
|
|
|
|
|
</target>
|
|
|
|
|
|
2004-03-16 23:57:17 +00:00
|
|
|
<target name="unzip-jboss" depends="" description="Unzip JBoss container">
|
2004-03-24 18:35:06 +00:00
|
|
|
<delete dir="${tmp.dir}/jboss-${jboss.version}"/>
|
|
|
|
|
<mkdir dir="${tmp.dir}/jboss-${jboss.version}"/>
|
|
|
|
|
<unzip src="${containers.dir}/jboss-${jboss.version}.zip" dest="${tmp.dir}"/>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="-report" description="Generates a browsable HTML report of the test run">
|
|
|
|
|
<mkdir dir="${reports.dir}/${product}/html"/>
|
|
|
|
|
<junitreport todir="${reports.dir}/${product}">
|
|
|
|
|
<fileset dir="${reports.dir}/${product}" includes="**/TEST-*.xml"/>
|
|
|
|
|
<report format="frames" todir="${reports.dir}/${product}/html"/>
|
|
|
|
|
</junitreport>
|
2004-03-16 23:57:17 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
</project>
|