1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<!-- Legacy Testcases for Velocity. See notes at the top
of the main build file
-->
<project name="main" default="test-all" basedir="..">
<property file="${user.home}/.ant.properties" />
<property file="${user.home}/build.properties" />
<property file=".ant.properties" />
<!-- This file contains all the defaults for building Velocity -->
<property file="build/build.properties" />
<!-- JUnit Testbed properties -->
<property name="test.runner" value="junit.textui.TestRunner"/>
<!-- Build classpath -->
<path id="velocity.test.classpath">
<fileset dir="${build.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${build.test.lib}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build.dest}"/>
<pathelement location="${build.test.dest}"/>
</path>
<!-- =================================================================== -->
<!-- JUnit Test Cases -->
<!-- =================================================================== -->
<target name="test-clean">
<!-- Delete the results directories -->
<delete dir="${build.test}/anakia" quiet="true"/>
<delete dir="${build.test}/cpload" quiet="true"/>
<delete dir="${build.test}/multiloader" quiet="true"/>
<delete dir="${build.test}/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="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
<arg value="org.apache.velocity.test.ClasspathResourceTestCase"/>
<classpath>
<path refid="velocity.test.classpath"/>
<pathelement location="${test.dir}/cpload/test1.jar"/>
<pathelement location="${test.dir}/cpload/test2.jar"/>
</classpath>
</java>
</target>
<target name="test-anakia">
<echo message="Running Anakia tests..."/>
<taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask"
classpathref="velocity.test.classpath"/>
<anakia basedir="${test.dir}/anakia/xdocs" destdir="${build.test}/anakia"
extension=".html" style="./site.vsl"
projectFile="./stylesheets/project.xml"
excludes="**/stylesheets/**"
includes="**/*.xml"
templatePath="${test.dir}/anakia/xdocs/stylesheets"
velocityPropertiesFile="${test.dir}/anakia/velocity.properties"
lastModifiedCheck="false">
</anakia>
<anakia basedir="${test.dir}/anakia/xdocs"
destdir="${build.test}/anakia"
extension=".context.html" style="./site_contexts.vsl"
projectFile="./stylesheets/project.xml"
excludes="**/stylesheets/**"
includes="**/*.xml"
templatePath="${test.dir}/anakia/xdocs/stylesheets"
lastModifiedCheck="false">
<context name="customContext" file="./stylesheets/customContext.xml"/>
</anakia>
<java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}"
classpathref="velocity.test.classpath">
<arg value="org.apache.velocity.test.AnakiaTestCase"/>
</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"
classpathref="velocity.test.classpath"/>
<texen
contextProperties="${test.dir}/texen/service.props,${test.dir}/texen/additional.props"
controlTemplate="Control.vm"
outputDirectory="${build.test}/texen"
templatePath="${test.dir}/texen/templates"
outputFile="report"
/>
<java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}"
classpathref="velocity.test.classpath">
<arg value="org.apache.velocity.test.TexenTestCase"/>
</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">
<taskdef name="texen" classname="org.apache.velocity.texen.ant.TexenTask">
<classpath>
<pathelement location="${test.dir}/texen-classpath/test.jar"/>
<path refid="velocity.test.classpath"/>
</classpath>
</taskdef>
<texen
useClassPath="true"
contextProperties="service.props"
controlTemplate="Control.vm"
outputDirectory="${build.test}/texen-classpath"
outputFile="report"
/>
<java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}"
classpathref="velocity.test.classpath">
<arg value="org.apache.velocity.test.TexenClasspathTestCase"/>
</java>
</target>
<target name="test-multiloader">
<echo message="Running MultiLoader tests..."/>
<java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
<arg value="org.apache.velocity.test.MultiLoaderTestCase"/>
<classpath>
<path refid="velocity.test.classpath"/>
<pathelement location="${test.dir}/multiloader/test1.jar"/>
</classpath>
</java>
</target>
<!-- use this test to directly test all the templates for a quick test cycle -->
<target name="test-templates">
<echo message="Running Template tests..."/>
<java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
<arg value="org.apache.velocity.test.TemplateTestCase"/>
<classpath>
<path refid="velocity.test.classpath"/>
</classpath>
</java>
</target>
</project>
|