You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2009/02/12 00:37:45 UTC
svn commit: r743566 - in /james/jsieve/trunk: build.xml mailet/build.xml
main/build.xml util/build.xml
Author: rdonkin
Date: Wed Feb 11 23:37:45 2009
New Revision: 743566
URL: http://svn.apache.org/viewvc?rev=743566&view=rev
Log:
Move duplicated test runner into macro. JSIEVE-45
Modified:
james/jsieve/trunk/build.xml
james/jsieve/trunk/mailet/build.xml
james/jsieve/trunk/main/build.xml
james/jsieve/trunk/util/build.xml
Modified: james/jsieve/trunk/build.xml
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/build.xml?rev=743566&r1=743565&r2=743566&view=diff
==============================================================================
--- james/jsieve/trunk/build.xml (original)
+++ james/jsieve/trunk/build.xml Wed Feb 11 23:37:45 2009
@@ -27,6 +27,29 @@
<project name='jsieve-master' default="main" basedir=".">
+ <macrodef name='RunTests'>
+ <sequential>
+ <echo message="Running tests" />
+ <mkdir dir="${build.dir}/reports" />
+ <junit printsummary="yes" haltonfailure="yes" filtertrace="on">
+ <!-- Uncomment this to remotely debug the tests
+ <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
+ -->
+ <classpath id="junit.class.path">
+ <pathelement path="${java.class.path}" />
+ <pathelement path='${build.classes.test}'/>
+ <path refid='project.test.class.path' />
+ </classpath>
+ <formatter type="plain" />
+ <batchtest fork="yes" todir="${build.dir}/reports">
+ <fileset dir="${build.classes.test}">
+ <include name="**/*Test.class" />
+ </fileset>
+ </batchtest>
+ </junit>
+ </sequential>
+ </macrodef>
+
<macrodef name='Clean'>
<sequential>
<echo message="deleting working directories ready for a clean build" />
@@ -89,13 +112,19 @@
</macrodef>
<macrodef name='CompileMain'>
+ <element name="src" implicit='true'/>
<sequential>
<echo message="Compiling JSieve sources" />
<mkdir dir="${build.classes}" />
- <javac destdir="${build.classes}" debug="${debug}" optimize="${optimize}" deprecation="${deprecation}" source="${jdk.source}" target="${jdk.target}">
+ <javac
+ destdir="${build.classes}"
+ debug="${debug}"
+ optimize="${optimize}"
+ deprecation="${deprecation}"
+ source="${jdk.source}"
+ target="${jdk.target}">
<classpath refid="project.class.path" />
- <src path="${build.src}" />
- <src path="${java.dir}" />
+ <src/>
<include name="org/apache/jsieve/**" />
</javac>
<copy todir="${build.classes}">
Modified: james/jsieve/trunk/mailet/build.xml
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/mailet/build.xml?rev=743566&r1=743565&r2=743566&view=diff
==============================================================================
--- james/jsieve/trunk/mailet/build.xml (original)
+++ james/jsieve/trunk/mailet/build.xml Wed Feb 11 23:37:45 2009
@@ -94,7 +94,9 @@
===================================================================
-->
<target name="compile" depends="prepare">
- <CompileMain/>
+ <CompileMain>
+ <src path="${java.dir}" />
+ </CompileMain>
<CompileTests/>
</target>
@@ -114,29 +116,7 @@
===================================================================
-->
<target name="run-tests" depends="jar">
- <echo message="Running tests" />
- <mkdir dir="${dist.dir}/reports" />
- <junit printsummary="yes" haltonfailure="yes" filtertrace="on">
- <!-- Uncomment this to remotely debug the tests
- <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
- -->
- <classpath id="junit.class.path">
- <pathelement location="${testconf.dir}" />
- <fileset dir="${dist.dir}/lib">
- <include name="**/*.jar" />
- </fileset>
- <pathelement location="${dist.dir}/conf/" />
- <pathelement path="${java.class.path}" />
- <pathelement location="${junit.jar}" />
- <path refid='mail.class.path' />
- </classpath>
- <formatter type="plain" />
- <batchtest fork="yes" todir="${dist.dir}/reports">
- <fileset dir="${build.classes.test}">
- <include name="**/*Test.class" />
- </fileset>
- </batchtest>
- </junit>
+ <RunTests/>
</target>
<!--
Modified: james/jsieve/trunk/main/build.xml
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/main/build.xml?rev=743566&r1=743565&r2=743566&view=diff
==============================================================================
--- james/jsieve/trunk/main/build.xml (original)
+++ james/jsieve/trunk/main/build.xml Wed Feb 11 23:37:45 2009
@@ -137,7 +137,10 @@
===================================================================
-->
<target name="compile" depends="prepare">
- <CompileMain/>
+ <CompileMain>
+ <src path="${build.src}" />
+ <src path="${java.dir}" />
+ </CompileMain>
<CompileTests/>
</target>
@@ -171,29 +174,7 @@
===================================================================
-->
<target name="run-tests" depends="jar">
- <echo message="Running tests" />
- <mkdir dir="${dist.dir}/reports" />
- <junit printsummary="yes" haltonfailure="yes" filtertrace="on">
- <!-- Uncomment this to remotely debug the tests
- <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
- -->
- <classpath id="junit.class.path">
- <pathelement location="${testconf.dir}" />
- <fileset dir="${dist.dir}/lib">
- <include name="**/*.jar" />
- </fileset>
- <pathelement location="${dist.dir}/conf/" />
- <pathelement path="${java.class.path}" />
- <pathelement location="${junit.jar}" />
- <path refid='mail.class.path' />
- </classpath>
- <formatter type="plain" />
- <batchtest fork="yes" todir="${dist.dir}/reports">
- <fileset dir="${build.classes.test}">
- <include name="**/*Test.class" />
- </fileset>
- </batchtest>
- </junit>
+ <RunTests/>
</target>
<!--
Modified: james/jsieve/trunk/util/build.xml
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/util/build.xml?rev=743566&r1=743565&r2=743566&view=diff
==============================================================================
--- james/jsieve/trunk/util/build.xml (original)
+++ james/jsieve/trunk/util/build.xml Wed Feb 11 23:37:45 2009
@@ -61,7 +61,7 @@
<pathelement location="${junit.jar}" />
<pathelement location="${jmock.jar}" />
</path>
-
+
<import file='../build.xml'/>
<!--
@@ -93,7 +93,9 @@
===================================================================
-->
<target name="compile" depends="prepare">
- <CompileMain/>
+ <CompileMain>
+ <src path="${java.dir}" />
+ </CompileMain>
<CompileTests/>
</target>
@@ -113,24 +115,7 @@
===================================================================
-->
<target name="run-tests" depends="jar">
- <echo message="Testing code" />
- <mkdir dir="${dist.dir}/reports" />
- <junit printsummary="yes" haltonfailure="yes" filtertrace="on">
- <!-- Uncomment this to remotely debug the tests
- <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
- -->
- <classpath id="junit.class.path">
- <pathelement location="${testconf.dir}" />
- <pathelement location='${build.classes.test}' />
- <path refid='project.test.class.path' />
- </classpath>
- <formatter type="plain" />
- <batchtest fork="yes" todir="${dist.dir}/reports">
- <fileset dir="${build.classes.test}">
- <include name="**/*Test.class" />
- </fileset>
- </batchtest>
- </junit>
+ <RunTests/>
</target>
<!--
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org