froehlich 02/01/20 06:01:20
Modified: simplestore build.xml
Log:
added junit test targets
Revision Changes Path
1.6 +33 -6 jakarta-commons-sandbox/simplestore/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/build.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- build.xml 15 Jan 2002 20:02:16 -0000 1.5
+++ build.xml 20 Jan 2002 14:01:20 -0000 1.6
@@ -3,7 +3,7 @@
<!--
"simplestore" component of the Jakarta Commons Subproject
- $Id: build.xml,v 1.5 2002/01/15 20:02:16 froehlich Exp $
+ $Id: build.xml,v 1.6 2002/01/20 14:01:20 froehlich Exp $
-->
@@ -38,7 +38,6 @@
<!-- ========== Component Declarations ==================================== -->
-
<!-- The name of this component -->
<property name="component.name" value="simplestore"/>
@@ -54,15 +53,23 @@
<!-- The base directory for compilation targets -->
<property name="build.home" value="build"/>
-
<!-- The base directory for distribution targets -->
<property name="dist.home" value="dist"/>
<!-- The base directory for component sources -->
<property name="source.home" value="src/java"/>
+
+ <property name="source.test" value="src/test"/>
<!-- The base directory for unit test sources -->
<property name="test.home" value="src/test"/>
+
+ <!-- The junit library -->
+ <property name="junit.jar" value="lib/junit.jar"/>
+
+ <property name="cp" value=""/>
+
+ <property name="classpath" value="${cp}:${junit.jar}"/>
<!-- ========== Compiler Defaults ========================================= -->
@@ -90,11 +97,12 @@
<!-- Construct unit test classpath -->
<path id="test.classpath">
<pathelement location="${build.home}/classes"/>
- <pathelement location="${build.home}/tests"/>
<pathelement location="${commons-collections.jar}"/>
<pathelement location="${junit.jar}"/>
</path>
+ <property name="test.entry" value="org.apache.commons.simplestore.TestAll"/>
+
<!-- Should all tests fail if one does? -->
<property name="test.failonerror" value="true"/>
@@ -104,7 +112,6 @@
<!-- ========== Executable Targets ======================================== -->
-
<target name="init"
description="Initialize and evaluate conditionals">
<echo message="-------- ${component.name} ${component.version} --------"/>
@@ -173,5 +180,25 @@
</jar>
</target>
-
+
+ <target name="build-test" depends="init,compile">
+ <mkdir dir="${dest.classes}"/>
+ <javac srcdir="${source.test}"
+ destdir="${build.home}/classes"
+ debug="${compile.debug}"
+ deprecation="${compile.deprecation}"
+ optimize="${compile.optimize}"/>
+ </target>
+
+ <target name="test" depends="build-test" description="runs (junit) unit tests">
+ <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
+ <arg value="${test.entry}"/>
+ <classpath>
+ <pathelement path=" ${build.home}/classes" />
+ <pathelement path="${classpath}" />
+ <pathelement path="${java.class.path}" />
+ </classpath>
+ </java>
+ </target>
+
</project>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>