| <?xml version="1.0"?> |
| |
| <!-- Testcases for Velocity --> |
| <project name="main" default="test-all"> |
| |
| <property name="build.dir" value="../bin"/> |
| <property name="build.dest" value="${build.dir}/classes"/> |
| <property name="ant.home" value="."/> |
| <property name="test.home" value="../test"/> |
| <property name="test.target" value="../target/test"/> |
| <property name="junit.jar" value="lib/junit-3.8.1.jar"/> |
| |
| <!-- JUnit Testbed properties --> |
| <property name="velocity.test.runner" value="junit.textui.TestRunner"/> |
| |
| <!-- Turns on/off overall failure if one test fails --> |
| <property name="testbed.failonerror" value="true"/> |
| |
| <!-- Build classpath --> |
| <path id="classpath"> |
| <fileset dir="./lib"> |
| <include name="**/*.jar"/> |
| </fileset> |
| <pathelement location="${build.dest}"/> |
| </path> |
| |
| <!-- =================================================================== --> |
| <!-- JUnit Test Cases --> |
| <!-- =================================================================== --> |
| <target name="test-clean"> |
| <!-- |
| Hack to prevent Ant from complaining about missing directories. |
| This is fixed in Ant >1.3, but we are using Ant 1.3 now. |
| --> |
| <mkdir dir="${test.target}/anakia"/> |
| <mkdir dir="${test.target}/cpload"/> |
| <mkdir dir="${test.target}/multiloader"/> |
| <mkdir dir="${test.target}/texen"/> |
| <!-- |
| Delete the results directories |
| --> |
| <delete dir="${test.target}/anakia" quiet="true"/> |
| <delete dir="${test.target}/cpload" quiet="true"/> |
| <delete dir="${test.target}/multiloader" quiet="true"/> |
| <delete dir="${test.target}/texen" quiet="true"/> |
| </target> |
| |
| <target name="test-all" depends=" |
| test-cpload, |
| test-anakia, |
| test-texen, |
| test-texen-classpath, |
| test-multiloader |
| "/> |
| |
| <target name="test-cpload"> |
| <echo message="Running Classpath Resource tests..."/> |
| |
| <java classname="${velocity.test.runner}" fork="yes" dir=".." failonerror="${testbed.failonerror}"> |
| <arg value="org.apache.velocity.test.ClasspathResourceTestCase"/> |
| <classpath> |
| <path refid="classpath"/> |
| <pathelement location="${test.home}/cpload/test1.jar"/> |
| <pathelement location="${test.home}/cpload/test2.jar"/> |
| </classpath> |
| </java> |
| </target> |
| |
| <target name="test-anakia"> |
| <echo message="Running Anakia tests..."/> |
| |
| <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask"> |
| <classpath> |
| <path refid="classpath"/> |
| </classpath> |
| </taskdef> |
| <anakia basedir="${test.home}/anakia/xdocs" destdir="${test.target}/anakia" |
| extension=".html" style="./site.vsl" |
| projectFile="./stylesheets/project.xml" |
| excludes="**/stylesheets/**" |
| includes="**/*.xml" |
| templatePath="${test.home}/anakia/xdocs/stylesheets" |
| velocityPropertiesFile="${test.home}/anakia/velocity.properties" |
| lastModifiedCheck="false"> |
| </anakia> |
| |
| <anakia basedir="${test.home}/anakia/xdocs" |
| destdir="${test.target}/anakia" |
| extension=".context.html" style="./site_contexts.vsl" |
| projectFile="./stylesheets/project.xml" |
| excludes="**/stylesheets/**" |
| includes="**/*.xml" |
| templatePath="${test.home}/anakia/xdocs/stylesheets" |
| lastModifiedCheck="false"> |
| |
| <context name="customContext" file="./stylesheets/customContext.xml"/> |
| </anakia> |
| |
| <java classname="${velocity.test.runner}" fork="yes" dir=".." failonerror="${testbed.failonerror}" > |
| <arg value="org.apache.velocity.test.AnakiaTestCase"/> |
| <classpath> |
| <path refid="classpath"/> |
| </classpath> |
| </java> |
| </target> |
| |
| <!-- ================================================================ --> |
| <!-- T E X E N T E S T --> |
| <!-- ================================================================ --> |
| <!-- Generate turbine service code via Texen --> |
| <!-- ================================================================ --> |
| |
| <target name="test-texen"> |
| |
| <taskdef name="texen" classname="org.apache.velocity.texen.ant.TexenTask"> |
| <classpath> |
| <path refid="classpath"/> |
| </classpath> |
| </taskdef> |
| |
| <texen |
| contextProperties="${test.home}/texen/service-ant.props,${test.home}/texen/additional.props" |
| controlTemplate="Control.vm" |
| outputDirectory="${test.target}/texen" |
| templatePath="${test.home}/texen/templates" |
| outputFile="report" |
| /> |
| |
| <java classname="${velocity.test.runner}" fork="yes" dir=".." failonerror="${testbed.failonerror}"> |
| <arg value="org.apache.velocity.test.TexenTestCase"/> |
| <classpath> |
| <path refid="classpath"/> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <!-- ================================================================ --> |
| <!-- T E X E N C L A S S P A T H --> |
| <!-- ================================================================ --> |
| <!-- Generate turbine service code via Texen with all the templates --> |
| <!-- and ancillary files in a JAR. --> |
| <!-- ================================================================ --> |
| |
| <target name="test-texen-classpath"> |
| |
| <!-- note: previously the taskdef included the mysterious attribute reverseLoader="true" --> |
| <!-- now that this has been removed, we only guarantee this works with ant 1.5+ --> |
| <taskdef name="texen" classname="org.apache.velocity.texen.ant.TexenTask" |
| > |
| <classpath> |
| <pathelement location="${test.home}/texen-classpath/test.jar"/> |
| <path refid="classpath"/> |
| </classpath> |
| </taskdef> |
| |
| <texen |
| useClassPath="true" |
| contextProperties="service-ant.props" |
| controlTemplate="Control.vm" |
| outputDirectory="${test.target}/texen-classpath" |
| outputFile="report" |
| /> |
| |
| <java classname="${velocity.test.runner}" fork="yes" dir=".." failonerror="${testbed.failonerror}"> |
| <arg value="org.apache.velocity.test.TexenClasspathTestCase"/> |
| <classpath> |
| <path refid="classpath"/> |
| </classpath> |
| </java> |
| |
| </target> |
| |
| <target name="test-multiloader"> |
| <echo message="Running MultiLoader tests..."/> |
| |
| <java classname="${velocity.test.runner}" fork="yes" dir=".." failonerror="${testbed.failonerror}"> |
| <arg value="org.apache.velocity.test.MultiLoaderTestCase"/> |
| <classpath> |
| <path refid="classpath"/> |
| <pathelement location="${test.home}/multiloader/test1.jar"/> |
| </classpath> |
| </java> |
| </target> |
| |
| </project> |