blob: afee253acbf839eb6597268897730453705cb71a [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright 1999-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id: test-build.xml,v 1.18 2004/03/21 18:35:15 gregor Exp $ -->
<project name="test">
<description>
Test Targets
</description>
<!-- === Test targets =========================================================== -->
<property name="test.pub.id" value="test"/>
<property name="test.pub.source.id" value="default"/>
<path id="classpath.default">
<path refid="classpath"/>
<pathelement location="${build.test}" />
<pathelement path="${build.root}/lenya/webapp/WEB-INF/classes" />
<fileset dir="${build.root}/lenya/webapp/WEB-INF/lib">
<include name="ant**.jar"/>
</fileset>
</path>
<!-- Runs all tests -->
<target name="test"
description="Runs all tests"
depends="tests.junit, tests.anteater, tests.webtest"/>
<!-- Prepares the test publication -->
<target name="test.pub.prepare">
<property name="test.pub.dir" value="${tomcat.home.dir}/${tomcat.webapps.dir}/lenya/pubs/${test.pub.id}"/>
<delete dir="${test.pub.dir}"/>
<mkdir dir="${test.pub.dir}"/>
<copy todir="${test.pub.dir}">
<fileset dir="${build.webapp}/lenya/pubs/${test.pub.source.id}"/>
</copy>
</target>
<!-- prepares the tests. -->
<target name="tests.prepare" depends="build-custom-tasks">
<mkdir dir="${build.test}"/>
<!-- Copy test files to build test dir -->
<copy todir="${build.test}" filtering="on">
<fileset dir="${src.test}" excludes="**/*.java"/>
</copy>
<copyJavaSources pubsrootdirs="${pubs.root.dirs}" javadir="java/test" builddir="${src.test}" />
<!-- Compile tests -->
<javac srcdir="${src.test}"
destdir="${build.test}"
debug="{debug}"
optimize="{optimize}"
deprecation="{deprecation}"
target="${target.vm}"
fork="true"
source="1.4">
<classpath refid="classpath"/>
<classpath>
<pathelement path="${build.root}/lenya/webapp/WEB-INF/classes" />
</classpath>
</javac>
</target>
<!-- Runs JUnit tests -->
<target name="tests.junit" depends="init, tests.prepare,
test.identity,
test.workflow,
test.anttask,
test.creator,
test.publisher,
test.accesscontrol,
test.deactivate,
test.publications"
/>
<!-- Identity Test -->
<target name="test.identity">
<java fork="yes" classname="org.apache.lenya.cms.ac.IdentityTestCase">
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="oscom"/>
<classpath refid="classpath"/>
<classpath>
<pathelement location="${build.test}" />
<pathelement path="${build.root}/lenya/webapp/WEB-INF/classes" />
</classpath>
</java>
</target>
<!-- AntTask Test -->
<target name="test.anttask" depends="test.pub.prepare">
<java
fork="yes"
classname="org.apache.lenya.cms.task.AntTaskTest"
>
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<classpath refid="classpath.default"/>
</java>
</target>
<!-- Workflow Test -->
<target name="test.workflow" depends="test.pub.prepare">
<java fork="yes" classname="org.apache.lenya.cms.workflow.WorkflowTest">
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<arg value="simple"/> <!-- document type -->
<classpath refid="classpath.default"/>
</java>
</target>
<!-- DocumentCreator Test -->
<target name="test.creator" depends="test.pub.prepare">
<java fork="yes" classname="org.apache.lenya.cms.authoring.DocumentCreatorTest">
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<classpath refid="classpath.default"/>
</java>
</target>
<!-- Publisher Test -->
<target name="test.publisher" depends="test.pub.prepare">
<java fork="yes" classname="org.apache.lenya.cms.task.PublisherTest">
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<classpath refid="classpath.default"/>
</java>
</target>
<!-- Access Control Test -->
<target name="test.accesscontrol" depends="test.pub.prepare">
<java fork="yes" classname="org.apache.lenya.cms.ac.AccessControlTest">
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<classpath refid="classpath.default"/>
</java>
</target>
<!-- Publication Test -->
<target name="test.publication" depends="test.pub.prepare">
<java fork="yes" classname="org.apache.lenya.cms.publication.PublicationTest">
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<classpath refid="classpath.default"/>
</java>
</target>
<!-- Deactivate Document Test -->
<target name="test.deactivate" depends="test.pub.prepare">
<java fork="yes" classname="org.apache.lenya.cms.task.DocumentDeactivateTaskTest">
<jvmarg value="-enableassertions"/>
<arg value="${tomcat.home.dir}/${tomcat.webapps.dir}"/>
<arg value="${test.pub.id}"/>
<classpath refid="classpath.default"/>
</java>
</target>
<!-- ================================================ -->
<!-- Anteater tests -->
<!-- ================================================ -->
<target name="tests.anteater">
<property name="anteater.home" value=""/>
<property name="anteater.buildfile" value="src/test/anteater/tests.xml"/>
<java classname="org.apache.tools.ant.Main" fork="true">
<classpath>
<pathelement location="${anteater.home}/resources"/>
<fileset dir="${anteater.home}">
<include name="lib/**/*.jar"/>
<include name="tomcat/**/*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Dant.home=${anteater.home}"/>
<jvmarg value="-Danteater.home=${anteater.home}" />
<jvmarg value="-Danteater.report=${anteater.home}/resources/scripts/report.xml" />
<jvmarg value="-Danteater.resources=${anteater.home}/resources" />
<arg line="-f ${anteater.buildfile}"/>
<arg value="-propertyfile" />
<arg value="${anteater.home}/resources/META-INF/Anteater.properties" />
<!--
<arg value="-Ddefault.debug=10"/>
-->
</java>
</target>
<!-- ================================================ -->
<!-- Canoo Webtest tests -->
<!-- ================================================ -->
<target name="tests.webtest">
<property name="webtest.home" value=""/>
<property name="webtest.buildfile" value="src/test/webtest/tests.xml"/>
<java classname="org.apache.tools.ant.Main" fork="true">
<classpath>
<fileset dir="${webtest.home}">
<include name="lib/**/*.jar"/>
</fileset>
<pathelement location="${webtest.home}/lib"/>
</classpath>
<jvmarg value="-Dwebtest.home=${webtest.home}" />
<arg line="-f ${webtest.buildfile}"/>
</java>
</target>
</project>