You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by he...@apache.org on 2005/10/09 13:35:05 UTC

svn commit: r307403 - in /jakarta/velocity/core/trunk: build/ src/test/org/apache/velocity/test/

Author: henning
Date: Sun Oct  9 04:34:52 2005
New Revision: 307403

URL: http://svn.apache.org/viewcvs?rev=307403&view=rev
Log:
First big chunk of reworking the ant build.

- pull root directories for test and test results into TemplateTestBase,
  make it configurable by running an ant filter on the sources (we do that
  anyway for things like date etc.)

- pull the common properties from build.xml and testcases.xml into a
  build.properties file


Modified:
    jakarta/velocity/core/trunk/build/build.xml
    jakarta/velocity/core/trunk/build/testcases.xml
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AbsoluteFileResourceLoaderTestCase.java   (contents, props changed)
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AnakiaTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BaseTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClasspathResourceTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/CommonsExtPropTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/IncludeEventHandlingTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultiLoaderTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultipleFileResourcePathTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ResourceLoaderInstanceTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TemplateTestBase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenClasspathTestCase.java
    jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenTestCase.java

Modified: jakarta/velocity/core/trunk/build/build.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/build/build.xml?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/build/build.xml (original)
+++ jakarta/velocity/core/trunk/build/build.xml Sun Oct  9 04:34:52 2005
@@ -1,7 +1,13 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
 
 <!-- Build file for Velocity -->
 
+<!-- This project has its basedir set to the root directory   -->
+<!-- of the velocity distribution. This is necessary so that  -->
+<!-- all the code that uses relative directory references     -->
+<!-- (like the tests) can be run in the same way when using   -->
+<!-- the ant based build and the maven based build.           -->
+<!-- *** DO NOT CHANGE THIS SETTING LIGHTLY! ***              -->
 <project name="Velocity" default="jar" basedir="..">
 
   <!-- Give user a chance to override without editing this file
@@ -10,72 +16,12 @@
   <property file="${user.home}/build.properties" />
   <property file=".ant.properties" />
 
-  <property name="Name" value="Velocity"/>
-  <property name="version" value="1.5-dev"/>
-
-  <property name="project" value="velocity"/>
-  <property name="velocity.dir" value="." />
-  <property name="velocity.build.dir" value="build" />
-  <property name="build.dir" value="${velocity.dir}/bin"/>
-  <property name="build.src" value="${build.dir}/src"/>
-  <property name="build.dest" value="${build.dir}/classes"/>
-
-  <property name="example.dir" value="${velocity.dir}/examples"/>
-
-  <property name="src.java.dir" value="${velocity.dir}/src/java"/>
-  <property name="test.java.dir" value="${velocity.dir}/src/test"/>
-  <property name="javadoc.destdir" value="${velocity.dir}/docs/docs/api"/>
-  <property name="final.name" value="${project}-${version}"/>
-  <property name="dist.root" value="${velocity.dir}/dist"/>
-  <property name="dist.dir" value="${dist.root}/${final.name}"/>
-  <property name="year" value="2005"/>
-
-  <property name="debug" value="on"/>
-  <property name="optimize" value="on"/>
-  <property name="deprecation" value="off"/>
-
-  <property name="docs.dest" value="${velocity.dir}/docs"/>
-  <property name="docs.src" value="${velocity.dir}/xdocs"/>
-
-  <!-- set to "project" for distribution and "project-website" -->
-  <!-- when building docs for web site -->
-  <property name="docs.project" value="project.xml"/>
-
-  <!-- jars explicitly needed for bulding 'dep jar' -->
-  <property name="log.jar" value="${velocity.build.dir}/lib/logkit-1.0.1.jar"/>
-  <property name="oro.jar" value="${velocity.build.dir}/lib/oro.jar"/>
-  <property name="collections.jar" value="${velocity.build.dir}/lib/commons-collections-3.1.jar" />
-  <property name="lang.jar" value="${velocity.build.dir}/lib/commons-lang-2.1.jar" />
-
-  <!-- PDF generation using FOP -->
-  <property name="xdocs.dir" value="${velocity.dir}/xdocs"/>
-  <property name="allfiles.xml" value="velocity-doc.xml"/>
-  <property name="outfile.fo" value="velocity.fo"/>
-  <property name="outfile.pdf" value="${velocity.dir}/docs/velocity.pdf"/>
-
-  <property
-    name="default.texen.properties"
-    value="org/apache/velocity/texen/defaults/texen.properties"
-  />
-
-  <property
-    name="runtime.defaults.dir"
-    value="org/apache/velocity/runtime/defaults"
-  />
-
-
-  <!-- Needs to be configured with system location of javacc for parser task -->
-  <property name="javacc.home" value="/javacc-3.2"/>
-
-
-  <!-- disabled for now == classpath issues
-    <taskdef name="fop" classname="Fop"/>
-    <taskdef name="xslt" classname="Xslt"/>
-  -->
+  <!-- This file contains all the defaults for building Velocity -->
+  <property file="build/build.properties" />
 
   <!-- Build classpath -->
-  <path id="classpath">
-    <fileset dir="${velocity.build.dir}/lib">
+  <path id="velocity.build.classpath">
+    <fileset dir="${velocity.lib.dir}">
       <include name="**/*.jar"/>
     </fileset>
   </path>
@@ -94,7 +40,7 @@
   **  Target         Depends on          Description
   **                                     default - see jar
   **  env                                echos environment variables to screen
-  **  prepare        env                 creates build dir, copies source
+  **  prepare                            creates build dir, copies source
   **  J2EE-error     prepare             message if J2EE missing but required
   **  parser         env                 calls jjtree and javacc
   **                                     (requires javaCC 3.1+ and ant 1.6.x)
@@ -131,224 +77,266 @@
   <!-- prints the environment                                              -->
   <!-- =================================================================== -->
   <target name="env">
-
     <echo message="java.home = ${java.home}"/>
     <echo message="user.home = ${user.home}"/>
     <echo message="java.class.path = ${java.class.path}"/>
     <echo message=""/>
-
   </target>
 
   <!-- =================================================================== -->
   <!-- Prepares the build directory                                        -->
   <!-- =================================================================== -->
-  <target name="prepare" depends="env">
+  <target name="prepare" depends="basic-prepare, prepare-jdbc, prepare-jdk14"/>
 
-    <tstamp/>
-    <filter token="year" value="${year}"/>
-    <filter token="version" value="${version}"/>
-    <filter token="date" value="${DSTAMP}"/>
+  <target name="basic-prepare">
+    <tstamp>
+      <format property="build.time" pattern="yyyy-MM-dd hh:mm:ss" />
+      <format property="build.year" pattern="yyyy"/>
+    </tstamp>
+    <filter token="build.year" value="${build.year}"/>
+    <filter token="build.version" value="${version}"/>
+    <filter token="build.time" value="${build.time}"/>
 
     <mkdir dir="${build.dir}"/>
     <mkdir dir="${build.dest}"/>
     <mkdir dir="${build.src}"/>
+    <mkdir dir="${build.test.src}"/>
+    <mkdir dir="${build.test.dest}"/>
 
     <copy todir="${build.src}" filtering="yes">
       <fileset dir="${src.java.dir}">
         <include name="**/*.java"/>
+        <exclude name="**/DataSourceResourceLoader.java"/>
+        <exclude name="**/JdkLogChute.java"/>
       </fileset>
     </copy>
 
-      <copy todir="${build.src}" filtering="yes">
-        <fileset dir="${test.java.dir}">
-          <include name="**/*.java"/>
-        </fileset>
-      </copy>
+    <filter token="test.dir" value="${test.dir}"/>
+    <filter token="build.test" value="${build.test}"/>
 
+    <copy todir="${build.test.src}" filtering="yes">
+      <fileset dir="${test.java.dir}">
+        <include name="**/*.java"/>
+      </fileset>
+    </copy>
+  </target>
+
+  <target name="prepare-jdbc" depends="check-jdbc,check-jdbc-true,check-jdbc-false"/>
+  <target name="prepare-jdk14" depends="check-jdk14,check-jdk14-true,check-jdk14-false"/>
+
+  <target name="check-jdbc">
     <!--  note: check to see if required class is available.  -->
     <!-- might be j2ee.jar, jdbc2_0-stdext.jar, or simply JDK 1.4+ -->
-    <available  classname="javax.sql.DataSource"
-       property="J2EE.present">
-       <classpath refid = "classpath"/>
-     </available>
-
+    <available classname="javax.sql.DataSource"
+               property="jdbc.present">
+      <classpath refid="velocity.build.classpath"/>
+    </available>
   </target>
 
-  <target name="J2EE-error" depends="prepare"  unless="J2EE.present">
-        <echo>
-           ********************************************************
-           **
-           **  J2EE has not been found and is needed for the target
-           **  you have chosen
-           **
-           **  Since CLASSPATH is an evil idea, just link or drop
-           **  a copy of your j2ee.jar into build/lib directory.
-           **
-           *********************************************************
-        </echo>
+  <target name="check-jdbc-true" if="jdbc.present">
+    <copy todir="${build.src}" filtering="yes">
+      <fileset dir="${src.java.dir}">
+        <include name="**/DataSourceResourceLoader.java"/>
+      </fileset>
+    </copy>
   </target>
 
+  <target name="check-jdbc-false" unless="jdbc.present">
+    <echo level="warning">
+      ********************************************************
+      **
+      ** The javax.sql.Datasource class has not been found on
+      ** your classpath. This means that your newly built 
+      ** Velocity jar will not contain the JDBC based resource
+      ** loaders. If this is a problem, please use a JDK for
+      ** building that contains the javax.sql.Datasource class.
+      **
+      ********************************************************
+    </echo>
+  </target>
 
-  <!-- =================================================================== -->
-  <!-- Calls jjtree and javacc                                             -->
-  <!-- =================================================================== -->
-  <target name="parser" depends="parser-setup,jjtree,javacc,javacc-cleanup,javacc-missing"/>
-
-   <target name="parser-setup" depends="env">
-        <echo>
-           ***********************************************************
-           ** Creating Parser.jj and Parser.java in source tree.
-           **
-           ** Note: ASTNode files generated by jjtree are
-           ** not generated with this task.  To create new ASTNode files,
-           ** run jjtree manually then copy the relevant files into
-           ** the runtime/parser/node directory (deleting all other
-           ** generated files).
-           **
-           ***********************************************************
-         </echo>
-
-         <echo message="This task requires javacc 3.1+ and ant 1.6.x to be installed."/>
-         <echo message="Checking javcc.home='${javacc.home}' and ant.version='${ant.version}'."/>
-
-         <condition property="parser-task-runnable">
-            <and>
-              <available file="${javacc.home}" type="dir"/>
-
-              <!-- include a list of acceptable ant versions here -->
-              <or>
-                  <contains string="${ant.version}" substring="1.6"/>
-              </or>
-            </and>
-          </condition>
-   </target>
-
-   <target name="jjtree" if="parser-task-runnable" depends="parser-setup">
-        <echo message="Running JJTree on Parser.jjt"/>
-        <delete file="${src.java.dir}/org/apache/velocity/runtime/parser/Parser.jj" />
-        <jjtree
-		  target="${src.java.dir}/org/apache/velocity/runtime/parser/Parser.jjt"
-          outputdirectory="${src.java.dir}/org/apache/velocity/runtime/parser/"
-          javacchome="${javacc.home}" buildnodefiles="false" />
-   </target>
-
-   <target name="javacc" if="parser-task-runnable" depends="parser-setup">
-        <echo message="Running JavaCC on Parser.jj"/>
-        <javacc target="${src.java.dir}/org/apache/velocity/runtime/parser/Parser.jj"
-        outputdirectory="${src.java.dir}/org/apache/velocity/runtime/parser/"
-        javacchome="${javacc.home}" />
-   </target>
-
-   <target name="javacc-cleanup" if="parser-task-runnable" depends="parser-setup">
-       <delete>
-           <fileset dir="${src.java.dir}/org/apache/velocity/runtime/parser/">
-               <include name="AST*"/>
-               <include name="Node.java"/>
-               <include name="SimpleNode.java"/>
-               <include name="ParserVisitor.java"/>
-           </fileset>
-       </delete>
-   </target>
+  <target name="check-jdk14">
+     <available classname="java.util.logging.Logger"
+               property="jdk14.present">
+      <classpath refid="velocity.build.classpath"/>
+    </available>
+  </target>
 
-   <target name="javacc-missing" unless="parser-task-runnable" depends="parser-setup">
-        <echo message="Couldn't run javacc."/>
-		<echo message="JavaCC 3.1+ must be installed at ${javacc.home}."/>
-		<echo message="Ant must be version 1.6.x."/>
-   </target>
+  <target name="check-jdk14-true" if="jdk14.present">
+    <copy todir="${build.src}" filtering="yes">
+      <fileset dir="${src.java.dir}">
+        <include name="**/JdkLogChute.java"/>
+      </fileset>
+    </copy>
+  </target>
 
+  <target name="check-jdk14-false" unless="jdk14.present">
+    <echo level="warning">
+      ********************************************************
+      **
+      ** The java.util.logging.Logger class has not been found on your
+      ** classpath. This means that your newly built Velocity jar will
+      ** not contain JDK 1.4 compatible logging code. If this is a
+      ** problem, please use a 1.4 or newer JDK for building.
+      **
+      ********************************************************
+    </echo>
+  </target>
 
   <!-- =================================================================== -->
-  <!-- Compiles the source directory without the J2EE dependent files      -->
+  <!-- Compiles the source tree and the tests                              -->
   <!-- =================================================================== -->
-  <target name="compile" depends="prepare">
+  <target name="compile" depends="compile-src, compile-test"/>
 
+  <target name="compile-src" depends="prepare,check-jdbc,check-jdk14">
     <javac srcdir="${build.src}"
       destdir="${build.dest}"
+      encoding="UTF-8"
       debug="${debug}"
       deprecation="${deprecation}"
       optimize="${optimize}">
 
-      <exclude  name="org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java"/>
-
-      <classpath refid="classpath"/>
+      <classpath refid="velocity.build.classpath"/>
     </javac>
 
-    <antcall target="compile-copy"/>
-  </target>
+    <copy todir="${build.dest}" filtering="yes">
+      <fileset dir="${src.java.dir}">
+        <include name="**/*.properties"/>
+      </fileset>
+    </copy>
 
-  <!-- =================================================================== -->
-  <!-- Compiles the source directory with the J2EE dependent files         -->
-  <!-- =================================================================== -->
-  <target name="compile-J2EE" depends="prepare, J2EE-error" if="J2EE.present">
+  </target>
 
-    <javac srcdir="${build.src}"
-      destdir="${build.dest}"
+  <target name="compile-test" depends="prepare,compile-src">
+    <javac srcdir="${build.test.src}"
+      destdir="${build.test.dest}"
+      encoding="UTF-8"
       debug="${debug}"
       deprecation="${deprecation}"
       optimize="${optimize}">
 
-      <classpath refid="classpath"/>
+      <classpath>
+        <path refid="velocity.build.classpath"/>
+        <pathelement location="${build.dest}"/>
+      </classpath>
     </javac>
 
-    <antcall target="compile-copy"/>
-
-  </target>
-
-  <!-- ====================================================================== -->
-  <!-- copies post-compile target files to the right place.  (This target     -->
-  <!-- created to prevent compile and compile-J2EE from repeating code...     -->
-  <!-- ====================================================================== -->
-  <target name="compile-copy">
-
-    <copy todir="${build.dest}/org/apache/velocity">
-      <fileset dir="${src.java.dir}/org/apache/velocity">
-        <include name="**/*.class"/>
+    <copy todir="${build.test.dest}" filtering="yes">
+      <fileset dir="${test.java.dir}">
+        <include name="**/*.properties"/>
       </fileset>
     </copy>
+  </target>
 
-    <copy todir="${build.dest}/${runtime.defaults.dir}">
-      <fileset dir="${src.java.dir}/${runtime.defaults.dir}">
-        <include name="*"/>
-      </fileset>
-    </copy>
 
-    <copy
-      file="${src.java.dir}/${default.texen.properties}"
-      tofile="${build.dest}/${default.texen.properties}"
-    />
+  <!-- =================================================================== -->
+  <!-- Calls jjtree and javacc                                             -->
+  <!-- =================================================================== -->
+  <target name="parser" depends="parser-check,jjtree,javacc,javacc-cleanup"/>
 
+  <target name="parser-check">
+    <condition property="javacc-home-unset">
+      <equals arg1="${javacc.home}" arg2="*unset*" />
+    </condition>
+
+    <fail if="javacc-home-unset">
+      Could not run javacc:
+      ***********************************************************
+      ** You have not configured your JavaCC installation
+      ** location in the javacc.home property.
+      ***********************************************************
+    </fail>
+
+    <condition property="parser-task-runnable">
+      <and>
+        <available file="${javacc.home}" type="dir"/>
+
+        <!-- include a list of acceptable ant versions here -->
+        <or>
+          <contains string="${ant.version}" substring="1.6"/>
+        </or>
+      </and>
+    </condition>
+
+    <fail unless="parser-task-runnable">
+      Could not run javacc:
+      ***********************************************************
+      **
+      ** JavaCC 3.1 or later must be installed at ${javacc.home}.
+      ** Ant must be at least version 1.6.x.
+      **
+      ***********************************************************
+    </fail>
+
+    <echo>
+       ***********************************************************
+       ** Creating Parser.jj and Parser.java in source tree.
+       **
+       ** Note: ASTNode files generated by jjtree are
+       ** not generated with this task.  To create new ASTNode files,
+       ** run jjtree manually then copy the relevant files into
+       ** the runtime/parser/node directory (deleting all other
+       ** generated files).
+       **
+       ***********************************************************
+    </echo>
   </target>
 
+  <target name="jjtree" depends="parser-check">
+       <echo message="Running JJTree on Parser.jjt"/>
+       <delete file="${src.java.dir}/org/apache/velocity/runtime/parser/Parser.jj" />
+       <jjtree
+                 target="${src.java.dir}/org/apache/velocity/runtime/parser/Parser.jjt"
+         outputdirectory="${src.java.dir}/org/apache/velocity/runtime/parser/"
+         javacchome="${javacc.home}" buildnodefiles="false" />
+  </target>
+
+  <target name="javacc" depends="parser-check">
+       <echo message="Running JavaCC on Parser.jj"/>
+       <javacc target="${src.java.dir}/org/apache/velocity/runtime/parser/Parser.jj"
+       outputdirectory="${src.java.dir}/org/apache/velocity/runtime/parser/"
+       javacchome="${javacc.home}" />
+  </target>
+
+  <target name="javacc-cleanup" depends="parser-check">
+      <delete>
+          <fileset dir="${src.java.dir}/org/apache/velocity/runtime/parser/">
+              <include name="AST*"/>
+              <include name="Node.java"/>
+              <include name="SimpleNode.java"/>
+              <include name="ParserVisitor.java"/>
+          </fileset>
+      </delete>
+  </target>
 
   <!-- ================================================================ -->
   <!--   Gets the classes we need from Jakarta Commons collections      -->
   <!-- ================================================================ -->
   <target name="collections-support">
-
     <unzip src="${collections.jar}" dest="${build.dest}" />
 
     <!--  we only want a few files -->
     <delete>
-       <fileset dir="${build.dest}">
-          <include name="org/apache/commons/collections/**/*.class" />
-          <exclude name="org/apache/commons/collections/BoundedMap.class" />
-          <exclude name="org/apache/commons/collections/ExtendedProperties*.class" />
-          <exclude name="org/apache/commons/collections/IterableMap.class" />
-          <exclude name="org/apache/commons/collections/iterators/AbstractEmptyIterator.class" />
-          <exclude name="org/apache/commons/collections/iterators/EmptyIterator.class" />
-          <exclude name="org/apache/commons/collections/iterators/EmptyMapIterator.class" />
-          <exclude name="org/apache/commons/collections/iterators/EmptyOrderedIterator.class" />
-          <exclude name="org/apache/commons/collections/iterators/EmptyOrderedMapIterator.class" />
-          <exclude name="org/apache/commons/collections/KeyValue.class" />
-          <exclude name="org/apache/commons/collections/map/AbstractHashedMap*.class" />
-          <exclude name="org/apache/commons/collections/map/AbstractLinkedMap*.class" />
-          <exclude name="org/apache/commons/collections/map/LRUMap.class" />
-          <exclude name="org/apache/commons/collections/MapIterator.class" />
-          <exclude name="org/apache/commons/collections/OrderedMap.class" />
-          <exclude name="org/apache/commons/collections/OrderedMapIterator.class" />
-          <exclude name="org/apache/commons/collections/OrderedIterator.class" />
-          <exclude name="org/apache/commons/collections/ResettableIterator.class" />
-	   </fileset>
+      <fileset dir="${build.dest}">
+        <include name="org/apache/commons/collections/**/*.class" />
+        <exclude name="org/apache/commons/collections/BoundedMap.class" />
+        <exclude name="org/apache/commons/collections/ExtendedProperties*.class" />
+        <exclude name="org/apache/commons/collections/IterableMap.class" />
+        <exclude name="org/apache/commons/collections/iterators/AbstractEmptyIterator.class" />
+        <exclude name="org/apache/commons/collections/iterators/EmptyIterator.class" />
+        <exclude name="org/apache/commons/collections/iterators/EmptyMapIterator.class" />
+        <exclude name="org/apache/commons/collections/iterators/EmptyOrderedIterator.class" />
+        <exclude name="org/apache/commons/collections/iterators/EmptyOrderedMapIterator.class" />
+        <exclude name="org/apache/commons/collections/KeyValue.class" />
+        <exclude name="org/apache/commons/collections/map/AbstractHashedMap*.class" />
+        <exclude name="org/apache/commons/collections/map/AbstractLinkedMap*.class" />
+        <exclude name="org/apache/commons/collections/map/LRUMap.class" />
+        <exclude name="org/apache/commons/collections/MapIterator.class" />
+        <exclude name="org/apache/commons/collections/OrderedMap.class" />
+        <exclude name="org/apache/commons/collections/OrderedMapIterator.class" />
+        <exclude name="org/apache/commons/collections/OrderedIterator.class" />
+        <exclude name="org/apache/commons/collections/ResettableIterator.class" />
+      </fileset>
     </delete>
 
   </target>
@@ -393,7 +381,7 @@
   <!-- =================================================================== -->
   <target name="jar" depends="compile">
 
-    <jar jarfile="${build.dir}/${project}-${version}.jar">
+    <jar jarfile="${build.dir}/${final.name}.jar">
 
       <metainf dir="${velocity.dir}" includes="LICENSE.txt"/>
       <fileset dir="${build.dest}">
@@ -420,6 +408,7 @@
   <!--  source AND code that requires J2EE (ex. DataSourceResourceLoader)  -->
   <!--  including Oro and LogKit for convenience                           -->
   <!-- =================================================================== -->
+<!--
   <target name="jar-J2EE-dep" depends="compile-J2EE, collections-support" if="J2EE.present">
 
     <unzip src="${log.jar}" dest="${build.dest}"/>
@@ -447,12 +436,13 @@
     </jar>
 
   </target>
-
+-->
   <!-- =================================================================== -->
   <!-- Compiles the source directory and creates a .jar file of all        -->
   <!-- source AND code that requires J2EE (ex. DataSourceResourceLoader)  -->
   <!-- but without built-in dependencies on Oro or Logkit                  -->
   <!-- =================================================================== -->
+<!--
   <target name="jar-J2EE" depends="compile-J2EE" if="J2EE.present">
 
     <jar jarfile="${build.dir}/${project}-J2EE-${version}.jar">
@@ -474,6 +464,7 @@
     </jar>
 
   </target>
+-->
 
   <!-- =================================================================== -->
   <!-- Compiles the source directory and creates a .jar file               -->
@@ -561,12 +552,13 @@
                   :${example.dir}/logger_example
                   :${example.dir}/xmlapp_example
                   :${example.dir}/event_example"
+      encoding="UTF-8"
       debug="${debug}"
       deprecation="${deprecation}"
       optimize="${optimize}">
 
       <classpath>
-        <path refid="classpath"/>
+        <path refid="velocity.build.classpath"/>
         <pathelement location="${build.dest}"/>
       </classpath>
 
@@ -591,27 +583,29 @@
   <!-- =================================================================== -->
   <target name="javadocs" depends="prepare">
 
-    <mkdir dir="${javadoc.destdir}"/>
+    <mkdir dir="${build.javadoc}"/>
 
     <javadoc
       sourcepath="${build.src}"
       packagenames="org.apache.velocity.*"
-      destdir="${javadoc.destdir}"
+      destdir="${build.javadoc}"
       author="true"
       private="true"
       version="true"
       use="true"
-      windowtitle="${Name} ${version} API"
-      doctitle="${Name} ${version} API"
-      bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights Reserved.">
+      windowtitle="${name} ${version} API"
+      doctitle="${name} ${version} API"
+      encoding="UTF-8"
+      docencoding="UTF-8"
+      bottom="Copyright &#169; 2000-${build.year} Apache Software Foundation. All Rights Reserved.">
 
-      <classpath refid="classpath"/>
+      <classpath refid="velocity.build.classpath"/>
 
     </javadoc>
   </target>
 
   <target name="javadocs-clean">
-    <delete dir="${javadoc.destdir}" quiet="true"/>
+    <delete dir="${build.javadoc}" quiet="true"/>
   </target>
 
   <!-- =================================================================== -->
@@ -707,10 +701,10 @@
   <target name="package-jar"
           depends="package"
           description="--> generates the .jar file">
-      <delete file="${velocity.dir}/${final.name}.jar" quiet="true"/>
+      <delete file="${build.dir}/${final.name}.jar" quiet="true"/>
 
       <jar
-          jarfile="${velocity.dir}/${final.name}.jar"
+          jarfile="${build.dir}/${final.name}.jar"
           basedir="${dist.root}"
           excludes="**/package.html"
       />
@@ -722,8 +716,8 @@
   <target name="package-zip"
           depends="package"
           description="--> generates the distribution as .zip">
-      <delete file="${velocity.dir}/${final.name}.zip" quiet="true"/>
-      <zip zipfile="${velocity.dir}/${final.name}.zip" basedir="${dist.root}"
+      <delete file="${build.dir}/${final.name}.zip" quiet="true"/>
+      <zip zipfile="${build.dir}/${final.name}.zip" basedir="${dist.root}"
            includes="**/${final.name}/**"/>
   </target>
 
@@ -733,11 +727,11 @@
   <target name="package-tgz"
           depends="package"
           description="--> generates the distribution as .tar.gz">
-      <delete file="${velocity.dir}/${final.name}.tar" quiet="true"/>
-      <delete file="${velocity.dir}/${final.name}.tar.gz" quiet="true"/>
-      <tar tarfile="${velocity.dir}/${final.name}.tar" basedir="${dist.root}"
+      <delete file="${build.dir}/${final.name}.tar" quiet="true"/>
+      <delete file="${build.dir}/${final.name}.tar.gz" quiet="true"/>
+      <tar tarfile="${build.dir}/${final.name}.tar" basedir="${dist.root}"
            includes="**/${final.name}/**" longfile="gnu"/>
-      <gzip zipfile="${velocity.dir}/${final.name}.tar.gz" src="${velocity.dir}/${final.name}.tar"/>
+      <gzip zipfile="${build.dir}/${final.name}.tar.gz" src="${build.dir}/${final.name}.tar"/>
   </target>
 
   <!-- ================================================================== -->
@@ -786,8 +780,8 @@
           classname="org.apache.velocity.anakia.AnakiaTask">
 
           <classpath>
-             <pathelement location="${build.dir}/${project}-${version}.jar"/>
-             <path refid="classpath"/>
+             <pathelement location="${build.dir}/${final.name}.jar"/>
+             <path refid="velocity.build.classpath"/>
           </classpath>
 
       </taskdef>
@@ -812,7 +806,7 @@
            excludes="**/stylesheets/** empty.xml"
            includes="**/*.xml"
            lastModifiedCheck="true"
-           templatePath="${velocity.dir}/xdocs/stylesheets">
+           templatePath="${xdocs.dir}/stylesheets">
       </anakia>
 
       <copy todir="${docs.dest}/images" filtering="no">
@@ -843,36 +837,6 @@
 
 
   <!-- =================================================================== -->
-  <!-- Make PDF version of Velocity documentation                          -->
-  <!-- =================================================================== -->
-  <!--
-  <target name="pdf">
-    <xslt
-      infile="${velocity.dir}/xdocs/site-book.xml"
-      xsltfile="${velocity.build.dir}/xsl/xml2xml.xsl"
-      outfile="${allfiles.xml}"
-      smart="yes"
-    />
-
-    <xslt
-      infile="${allfiles.xml}"
-      xsltfile="${velocity.build.dir}/xsl/xml2pdf.xsl"
-      outfile="${outfile.fo}"
-      smart="yes"
-    />
-
-    <fop
-      fofile="${outfile.fo}"
-      pdffile="${outfile.pdf}"
-    />
-
-    <delete file="${allfiles.xml}"/>
-    <delete file="${outfile.fo}"/>
-
-  </target>
-  -->
-
-  <!-- =================================================================== -->
   <!-- JUnit Tests for Velocity                                            -->
   <!-- =================================================================== -->
    <target name="test"
@@ -884,17 +848,19 @@
     <target name="junittest" depends="compile"
                  description="Run non-legacy unit test cases">
 
-        <mkdir dir="${velocity.dir}/target/test-reports"/>
-        <junit dir="${velocity.dir}" printSummary="yes" fork="true" haltonerror="true">
+        <mkdir dir="${build.test.reports}"/>
+        <junit dir="${velocity.dir}" printSummary="yes" fork="true" haltonerror="${test.haltonerror}" haltonfailure="${test.haltonfailure}">
 
           <classpath>
-            <fileset dir="${velocity.build.dir}/lib">
+            <fileset dir="${velocity.lib.dir}">
               <include name="*.jar"></include>
             </fileset>
-            <pathelement path="${build.dest}"></pathelement>
+            <path refid="velocity.build.classpath" />
+            <pathelement path="${build.dest}"/>
+            <pathelement path="${build.test.dest}"/>
           </classpath>
 
-          <batchtest todir="${velocity.dir}/target/test-reports">
+          <batchtest todir="${build.test.reports}">
             <fileset dir="${test.java.dir}">
                 <include name="**/*TestCase.java"></include>
 

Modified: jakarta/velocity/core/trunk/build/testcases.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/build/testcases.xml?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/build/testcases.xml (original)
+++ jakarta/velocity/core/trunk/build/testcases.xml Sun Oct  9 04:34:52 2005
@@ -6,20 +6,11 @@
   <property file="${user.home}/build.properties" />
   <property file=".ant.properties" />
 
-  <property name="velocity.dir" value="." />  
-  <property name="velocity.build.dir" value="build" />  
-
-  <property name="build.dir" value="${velocity.dir}/bin"/>
-  <property name="build.dest" value="${build.dir}/classes"/>
-  <property name="test.home" value="${velocity.dir}/test"/>
-  <property name="test.target" value="${velocity.dir}/target/test"/>
-  <property name="junit.jar" value="${velocity.build.dir}/lib/junit-3.8.1.jar"/>
+  <!-- This file contains all the defaults for building Velocity -->
+  <property file="build/build.properties" />
 
   <!-- 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"/>
+  <property name="test.runner" value="junit.textui.TestRunner"/>
 
   <!-- Build classpath -->
   <path id="classpath">
@@ -27,6 +18,7 @@
       <include name="**/*.jar"/>
     </fileset>
     <pathelement location="${build.dest}"/>
+    <pathelement location="${build.test.dest}"/>
   </path>
 
   <!-- =================================================================== -->
@@ -37,17 +29,17 @@
          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"/>
+    <mkdir dir="${build.test}/anakia"/>
+    <mkdir dir="${build.test}/cpload"/>
+    <mkdir dir="${build.test}/multiloader"/>
+    <mkdir dir="${build.test}/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"/>
+    <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="
@@ -61,12 +53,12 @@
   <target name="test-cpload">
     <echo message="Running Classpath Resource tests..."/>
 
-    <java classname="${velocity.test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${testbed.failonerror}">
+    <java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
       <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"/>
+        <pathelement location="${test.dir}/cpload/test1.jar"/>
+        <pathelement location="${test.dir}/cpload/test2.jar"/>
       </classpath>
     </java>
   </target>
@@ -79,29 +71,29 @@
         <path refid="classpath"/>
       </classpath>
     </taskdef>
-    <anakia basedir="${test.home}/anakia/xdocs" destdir="${test.target}/anakia"
+    <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.home}/anakia/xdocs/stylesheets"
-            velocityPropertiesFile="${test.home}/anakia/velocity.properties"
+            templatePath="${test.dir}/anakia/xdocs/stylesheets"
+            velocityPropertiesFile="${test.dir}/anakia/velocity.properties"
             lastModifiedCheck="false">
     </anakia>
   
-    <anakia basedir="${test.home}/anakia/xdocs" 
-            destdir="${test.target}/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.home}/anakia/xdocs/stylesheets"
+        templatePath="${test.dir}/anakia/xdocs/stylesheets"
         lastModifiedCheck="false">
         
         <context name="customContext" file="./stylesheets/customContext.xml"/>
     </anakia>    
  
-    <java classname="${velocity.test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${testbed.failonerror}" >
+    <java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}" >
       <arg value="org.apache.velocity.test.AnakiaTestCase"/>
       <classpath>
         <path refid="classpath"/>
@@ -124,14 +116,14 @@
     </taskdef>
 
     <texen
-      contextProperties="${test.home}/texen/service.props,${test.home}/texen/additional.props"
+      contextProperties="${test.dir}/texen/service.props,${test.dir}/texen/additional.props"
       controlTemplate="Control.vm"
-      outputDirectory="${test.target}/texen"
-      templatePath="${test.home}/texen/templates"
+      outputDirectory="${build.test}/texen"
+      templatePath="${test.dir}/texen/templates"
       outputFile="report"
     />
 
-    <java classname="${velocity.test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${testbed.failonerror}">
+    <java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
       <arg value="org.apache.velocity.test.TexenTestCase"/>
       <classpath>
         <path refid="classpath"/>
@@ -154,7 +146,7 @@
     <taskdef name="texen" classname="org.apache.velocity.texen.ant.TexenTask"
        >
       <classpath>
-        <pathelement location="${test.home}/texen-classpath/test.jar"/>
+        <pathelement location="${test.dir}/texen-classpath/test.jar"/>
         <path refid="classpath"/>
       </classpath>
     </taskdef>
@@ -163,11 +155,11 @@
       useClassPath="true"
       contextProperties="service.props"
       controlTemplate="Control.vm"
-      outputDirectory="${test.target}/texen-classpath"
+      outputDirectory="${build.test}/texen-classpath"
       outputFile="report"
     />
 
-    <java classname="${velocity.test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${testbed.failonerror}">
+    <java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
       <arg value="org.apache.velocity.test.TexenClasspathTestCase"/>
       <classpath>
         <path refid="classpath"/>
@@ -179,11 +171,11 @@
   <target name="test-multiloader">
     <echo message="Running MultiLoader tests..."/>
 
-    <java classname="${velocity.test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${testbed.failonerror}">
+    <java classname="${test.runner}" fork="yes" dir="${velocity.dir}" failonerror="${test.haltonerror}">
       <arg value="org.apache.velocity.test.MultiLoaderTestCase"/>
       <classpath>
         <path refid="classpath"/>
-        <pathelement location="${test.home}/multiloader/test1.jar"/>
+        <pathelement location="${test.dir}/multiloader/test1.jar"/>
       </classpath>
     </java>
   </target>

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AbsoluteFileResourceLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AbsoluteFileResourceLoaderTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AbsoluteFileResourceLoaderTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AbsoluteFileResourceLoaderTestCase.java Sun Oct  9 04:34:52 2005
@@ -1,142 +1,142 @@
-package org.apache.velocity.test;
-
-/*
- * Copyright 2001-2005 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.
- */
-
-import java.io.BufferedWriter;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import junit.framework.Test;
-
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.RuntimeSingleton;
-
-/**
- * Test use of an absolute path with the FileResourceLoader
- *
- * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
- * @version $Id$
- */
-public class AbsoluteFileResourceLoaderTestCase extends BaseTestCase
-{
-     /**
-     * VTL file extension.
-     */
-    private static final String TMPL_FILE_EXT = "vm";
-
-    /**
-     * Comparison file extension.
-     */
-    private static final String CMP_FILE_EXT = "cmp";
-
-    /**
-     * Comparison file extension.
-     */
-    private static final String RESULT_FILE_EXT = "res";
-
-    /**
-     * Path to template file.  This will get combined with the 
-     * application directory to form an absolute path
-     */
-    private final static String TEMPLATE_PATH = "test/absolute/absolute";
-
-    /**
-     * Results relative to the build directory.
-     */
-    private static final String RESULTS_DIR = "target/test/absolute/results";
-
-    /**
-     * Results relative to the build directory.
-     */
-    private static final String COMPARE_DIR = "test/absolute/compare";
-
-    /**
-     * Default constructor.
-     */
-    AbsoluteFileResourceLoaderTestCase()
-    {
-        super("AbsoluteFileResourceLoaderTest");
-
-        try
-        {
-            assureResultsDirectoryExists(RESULTS_DIR);
-
-
-            // signify we want to use an absolute path
-            Velocity.addProperty(
-                Velocity.FILE_RESOURCE_LOADER_PATH, "");
-
-            Velocity.init();
-        }
-        catch (Exception e)
-        {
-            System.err.println("Cannot setup AbsoluteFileResourceLoaderTest!");
-            e.printStackTrace();
-            System.exit(1);
-        }
-    }
-
-    public static Test suite ()
-    {
-        return new AbsoluteFileResourceLoaderTestCase();
-    }
-
-    /**
-     * Runs the test.
-     */
-    public void runTest ()
-    {
-        try
-        {
-
-            String curdir = System.getProperty("user.dir");
-            String f = getFileName(curdir, TEMPLATE_PATH, TMPL_FILE_EXT);
-
-            System.out.println("Retrieving template at absolute path: " + f);
-
-            Template template1 = RuntimeSingleton.getTemplate(f);
-
-            FileOutputStream fos1 =
-                new FileOutputStream (
-                    getFileName(RESULTS_DIR, "absolute", RESULT_FILE_EXT));
-
-            Writer writer1 = new BufferedWriter(new OutputStreamWriter(fos1));
-
-            /*
-             *  put the Vector into the context, and merge both
-             */     
-            VelocityContext context = new VelocityContext();
-
-            template1.merge(context, writer1);
-            writer1.flush();
-            writer1.close();
-
-            if (!isMatch(RESULTS_DIR, COMPARE_DIR, "absolute",
-                    RESULT_FILE_EXT, CMP_FILE_EXT))
-            {
-                fail("Output incorrect.");
-            }
-        }
-        catch (Exception e)
-        {
-            fail(e.getMessage());
-        }
-    }
-}
+package org.apache.velocity.test;
+
+/*
+ * Copyright 2001-2005 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.
+ */
+
+import java.io.BufferedWriter;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import junit.framework.Test;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.runtime.RuntimeSingleton;
+
+/**
+ * Test use of an absolute path with the FileResourceLoader
+ *
+ * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
+ * @version $Id$
+ */
+public class AbsoluteFileResourceLoaderTestCase extends BaseTestCase
+{
+     /**
+     * VTL file extension.
+     */
+    private static final String TMPL_FILE_EXT = "vm";
+
+    /**
+     * Comparison file extension.
+     */
+    private static final String CMP_FILE_EXT = "cmp";
+
+    /**
+     * Comparison file extension.
+     */
+    private static final String RESULT_FILE_EXT = "res";
+
+    /**
+     * Path to template file.  This will get combined with the 
+     * application directory to form an absolute path
+     */
+    private final static String TEMPLATE_PATH = TEST_COMPARE_DIR + "/absolute/absolute";
+
+    /**
+     * Results relative to the build directory.
+     */
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/absolute/results";
+
+    /**
+     * Results relative to the build directory.
+     */
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/absolute/compare";
+
+    /**
+     * Default constructor.
+     */
+    AbsoluteFileResourceLoaderTestCase()
+    {
+        super("AbsoluteFileResourceLoaderTest");
+
+        try
+        {
+            assureResultsDirectoryExists(RESULTS_DIR);
+
+
+            // signify we want to use an absolute path
+            Velocity.addProperty(
+                Velocity.FILE_RESOURCE_LOADER_PATH, "");
+
+            Velocity.init();
+        }
+        catch (Exception e)
+        {
+            System.err.println("Cannot setup AbsoluteFileResourceLoaderTest!");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    public static Test suite ()
+    {
+        return new AbsoluteFileResourceLoaderTestCase();
+    }
+
+    /**
+     * Runs the test.
+     */
+    public void runTest ()
+    {
+        try
+        {
+
+            String curdir = System.getProperty("user.dir");
+            String f = getFileName(curdir, TEMPLATE_PATH, TMPL_FILE_EXT);
+
+            System.out.println("Retrieving template at absolute path: " + f);
+
+            Template template1 = RuntimeSingleton.getTemplate(f);
+
+            FileOutputStream fos1 =
+                new FileOutputStream (
+                    getFileName(RESULTS_DIR, "absolute", RESULT_FILE_EXT));
+
+            Writer writer1 = new BufferedWriter(new OutputStreamWriter(fos1));
+
+            /*
+             *  put the Vector into the context, and merge both
+             */     
+            VelocityContext context = new VelocityContext();
+
+            template1.merge(context, writer1);
+            writer1.flush();
+            writer1.close();
+
+            if (!isMatch(RESULTS_DIR, COMPARE_DIR, "absolute",
+                    RESULT_FILE_EXT, CMP_FILE_EXT))
+            {
+                fail("Output incorrect.");
+            }
+        }
+        catch (Exception e)
+        {
+            fail(e.getMessage());
+        }
+    }
+}

Propchange: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AbsoluteFileResourceLoaderTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AnakiaTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AnakiaTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AnakiaTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/AnakiaTestCase.java Sun Oct  9 04:34:52 2005
@@ -29,8 +29,8 @@
  */
 public class AnakiaTestCase extends BaseTestCase
 {
-    private static final String COMPARE_DIR = "test/anakia/compare";
-    private static final String RESULTS_DIR = "target/test/anakia";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/anakia/compare";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/anakia";
 
     private static final String CONTEXT_FILE_EXT = "context.html";
 

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BaseTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BaseTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BaseTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BaseTestCase.java Sun Oct  9 04:34:52 2005
@@ -31,7 +31,9 @@
  * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  * @version $Id$
  */
-public abstract class BaseTestCase extends TestCase
+public abstract class BaseTestCase
+        extends TestCase
+        implements TemplateTestBase
 {
     /**
      *  used for nomalization of output and compare data

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java Sun Oct  9 04:34:52 2005
@@ -65,17 +65,17 @@
     * Path for templates. This property will override the
     * value in the default velocity properties file.
     */
-   private final static String FILE_RESOURCE_LOADER_PATH = "test/includeevent";
+   private final static String FILE_RESOURCE_LOADER_PATH = TEST_COMPARE_DIR + "/includeevent";
 
    /**
     * Results relative to the build directory.
     */
-   private static final String RESULTS_DIR = "target/test/includeevent";
+   private static final String RESULTS_DIR = TEST_RESULT_DIR + "/includeevent";
 
    /**
     * Results relative to the build directory.
     */
-   private static final String COMPARE_DIR = "test/includeevent/compare";
+   private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/includeevent/compare";
 
     /**
      * Default constructor.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClasspathResourceTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClasspathResourceTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClasspathResourceTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClasspathResourceTestCase.java Sun Oct  9 04:34:52 2005
@@ -56,12 +56,12 @@
     /**
      * Results relative to the build directory.
      */
-    private static final String RESULTS_DIR = "target/test/cpload";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/cpload";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String COMPARE_DIR = "test/cpload/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/cpload/compare";
 
     /**
      * Default constructor.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/CommonsExtPropTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/CommonsExtPropTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/CommonsExtPropTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/CommonsExtPropTestCase.java Sun Oct  9 04:34:52 2005
@@ -40,19 +40,19 @@
      * Comparison directory.
      */
     private static final String COMPARE_DIR =
-        "test/configuration/compare";
+        TEST_COMPARE_DIR + "/configuration/compare";
 
     /**
      * Results directory.
      */
     private static final String RESULTS_DIR =
-        "target/test/configuration";
+        TEST_RESULT_DIR + "/configuration";
 
     /**
      * Test configuration
      */
     private static final String TEST_CONFIG =
-        "test/configuration/test.config";
+        TEST_COMPARE_DIR + "/configuration/test.config";
 
     /**
      * Creates a new instance.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java Sun Oct  9 04:34:52 2005
@@ -63,17 +63,17 @@
     * Path for templates. This property will override the
     * value in the default velocity properties file.
     */
-   private final static String FILE_RESOURCE_LOADER_PATH = "test/includeevent";
+   private final static String FILE_RESOURCE_LOADER_PATH = TEST_COMPARE_DIR + "/includeevent";
 
    /**
     * Results relative to the build directory.
     */
-   private static final String RESULTS_DIR = "target/test/includeevent";
+   private static final String RESULTS_DIR = TEST_RESULT_DIR + "/includeevent";
 
    /**
     * Results relative to the build directory.
     */
-   private static final String COMPARE_DIR = "test/includeevent/compare";
+   private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/includeevent/compare";
 
 
     private String logString = null;

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/IncludeEventHandlingTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/IncludeEventHandlingTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/IncludeEventHandlingTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/IncludeEventHandlingTestCase.java Sun Oct  9 04:34:52 2005
@@ -63,17 +63,17 @@
      * Path for templates. This property will override the
      * value in the default velocity properties file.
      */
-    private final static String FILE_RESOURCE_LOADER_PATH = "test/includeevent";
+    private final static String FILE_RESOURCE_LOADER_PATH = TEST_COMPARE_DIR + "/includeevent";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String RESULTS_DIR = "target/test/includeevent";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/includeevent";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String COMPARE_DIR = "test/includeevent/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/includeevent/compare";
 
 
     private static final int PASS_THROUGH=0;

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultiLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultiLoaderTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultiLoaderTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultiLoaderTestCase.java Sun Oct  9 04:34:52 2005
@@ -55,18 +55,18 @@
     /**
      * Results relative to the build directory.
      */
-    private static final String RESULTS_DIR = "target/test/multiloader";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/multiloader";
 
     /**
      * Path for templates. This property will override the
      * value in the default velocity properties file.
      */
-    private final static String FILE_RESOURCE_LOADER_PATH = "test/multiloader";
+    private final static String FILE_RESOURCE_LOADER_PATH = TEST_COMPARE_DIR + "/multiloader";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String COMPARE_DIR = "test/multiloader/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/multiloader/compare";
 
     /**
      * Default constructor.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultipleFileResourcePathTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultipleFileResourcePathTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultipleFileResourcePathTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/MultipleFileResourcePathTestCase.java Sun Oct  9 04:34:52 2005
@@ -56,23 +56,23 @@
      * Path for templates. This property will override the
      * value in the default velocity properties file.
      */
-    private final static String FILE_RESOURCE_LOADER_PATH1 = "test/multi/path1";
+    private final static String FILE_RESOURCE_LOADER_PATH1 = TEST_COMPARE_DIR + "/multi/path1";
 
     /**
      * Path for templates. This property will override the
      * value in the default velocity properties file.
      */
-    private final static String FILE_RESOURCE_LOADER_PATH2 = "test/multi/path2";
+    private final static String FILE_RESOURCE_LOADER_PATH2 = TEST_COMPARE_DIR + "/multi/path2";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String RESULTS_DIR = "target/test/multi";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/multi";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String COMPARE_DIR = "test/multi/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/multi/compare";
 
     /**
      * Default constructor.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ResourceLoaderInstanceTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ResourceLoaderInstanceTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ResourceLoaderInstanceTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ResourceLoaderInstanceTestCase.java Sun Oct  9 04:34:52 2005
@@ -58,17 +58,17 @@
      * Path for templates. This property will override the
      * value in the default velocity properties file.
      */
-    private final static String FILE_RESOURCE_LOADER_PATH = "test/resourceinstance";
+    private final static String FILE_RESOURCE_LOADER_PATH = TEST_COMPARE_DIR + "/resourceinstance";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String RESULTS_DIR = "target/test/resourceinstance";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/resourceinstance";
 
     /**
      * Results relative to the build directory.
      */
-    private static final String COMPARE_DIR = "test/resourceinstance/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/resourceinstance/compare";
 
     /**
      * Default constructor.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TemplateTestBase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TemplateTestBase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TemplateTestBase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TemplateTestBase.java Sun Oct  9 04:34:52 2005
@@ -25,6 +25,19 @@
  */
 public interface TemplateTestBase
 {
+    /** 
+     * Directory relative to the distribution root, where the 
+     * values to compare test results to are stored.
+     */
+    public static final String TEST_COMPARE_DIR = "@test.dir@";
+
+    /**
+     * Directory relative to the distribution root, where the
+     * test cases should put their output
+     */
+    public static final String TEST_RESULT_DIR = "@build.test@";
+
+
     /**
      * VTL file extension.
      */
@@ -45,7 +58,7 @@
      * value in the default velocity properties file.
      */
     public final static String FILE_RESOURCE_LOADER_PATH =
-                          "test/templates";
+                          TEST_COMPARE_DIR + "/templates";
 
     /**
      * Properties file that lists which template tests to run.
@@ -57,7 +70,7 @@
      * Results relative to the build directory.
      */
     public final static String RESULT_DIR =
-                          "target/test/templates";
+                          TEST_RESULT_DIR + "/templates";
 
     /**
      * Results relative to the build directory.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenClasspathTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenClasspathTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenClasspathTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenClasspathTestCase.java Sun Oct  9 04:34:52 2005
@@ -33,12 +33,12 @@
     /**
      * Directory where results are generated.
      */
-    private static final String RESULTS_DIR = "target/test/texen-classpath";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/texen-classpath";
 
     /**
      * Directory where comparison output is stored.
      */
-    private static final String COMPARE_DIR = "test/texen-classpath/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/texen-classpath/compare";
 
     /**
      * Creates a new instance.

Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenTestCase.java?rev=307403&r1=307402&r2=307403&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/TexenTestCase.java Sun Oct  9 04:34:52 2005
@@ -31,12 +31,12 @@
     /**
      * Directory where results are generated.
      */
-    private static final String RESULTS_DIR = "target/test/texen";
+    private static final String RESULTS_DIR = TEST_RESULT_DIR + "/texen";
 
     /**
      * Directory where comparison output is stored.
      */
-    private static final String COMPARE_DIR = "test/texen/compare";
+    private static final String COMPARE_DIR = TEST_COMPARE_DIR + "/texen/compare";
 
     /**
      * Creates a new instance.



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org