blob: 2c9c0be48fb699d78d8eed0fda6959c990d15c6c [file] [log] [blame]
<?xml version="1.0"?>
<project name="test">
<description>
Test targets
</description>
<!-- Runs all tests -->
<target name="test" depends="junit-tests, block-tests" description="Runs all tests"/>
<!-- Runs JUnit tests -->
<target name="junit-tests" depends="compile-tests">
<junit printsummary="yes" haltonfailure="yes" fork="yes">
<classpath refid="test.classpath"/>
<formatter type="plain" usefile="no" />
<batchtest>
<fileset dir="${build.test}">
<include name="**/*TestCase.class"/>
<include name="**/*Test.class" />
<exclude name="**/AllTest.class" />
<exclude name="**/*$$*Test.class" />
<exclude name="**/Abstract*.class" />
<exclude name="**/SitemapComponentTestCase*"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Anteater tests -->
<target name="anteater-tests" depends="compile-tests,block-anteater-tests">
<!-- anteater parameters are set in build.properties -->
<available file="${anteater.home}" property="anteater.present"/>
<fail unless="anteater.present"
message="To use anteater, please install it and set anteater.home (currently ${anteater.home}) in your local.build.properties"/>
<echo>To run these tests, another instance of Cocoon must be running at ${anteater.target.host}:${anteater.target.port} (base path=${anteater.target.base.path})</echo>
<java classname="org.apache.tools.ant.Main" fork="true">
<classpath>
<fileset dir="${anteater.home}">
<include name="lib/**/*.jar"/>
<include name="tomcat/**/*.jar"/>
</fileset>
<pathelement location="${anteater.home}/resources"/>
</classpath>
<jvmarg value="-Dant.home=${anteater.home}"/>
<jvmarg value="-Danteater.home=${anteater.home}"/>
<jvmarg value="-Danteater.resources=${anteater.home}/resources"/>
<jvmarg value="-Danteater.report=${anteater.home}/resources/scripts/report.xml"/>
<jvmarg value="-Djava.endorsed.dirs=${anteater.home}/lib"/>
<arg line="-f ${build.test}/anteater/all-tests.xml -Dhost=${anteater.target.host} -Dport=${anteater.target.port} -Dbase=${anteater.target.base.path} -Ddefault.haltonerror=${anteater.option.haltonerror}"/>
</java>
</target>
<!-- Block tests -->
<target name="block-tests" depends="compile-tests, prepare-blocks">
<ant antfile="${build.temp}/blocks-build.xml"
inheritAll="true"
inheritRefs="false"
target="tests"/>
</target>
<target name="block-anteater-tests" depends="prepare-blocks">
<ant antfile="${build.temp}/blocks-build.xml"
inheritAll="true"
inheritRefs="false"
target="prepare-anteater-tests"/>
</target>
</project>