gcasper 2003/09/11 15:55:56
Modified: src/targets test-build.xml
src/test/anteater all-tests.xml
tools/src blocks-build.xsl
Log:
Enabled Anteater tests per block
Revision Changes Path
1.19 +10 -2 cocoon-2.1/src/targets/test-build.xml
Index: test-build.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/targets/test-build.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- test-build.xml 11 Sep 2003 17:08:38 -0000 1.18
+++ test-build.xml 11 Sep 2003 22:55:56 -0000 1.19
@@ -21,7 +21,7 @@
</target>
<!-- Anteater tests -->
- <target name="anteater-tests">
+ <target name="anteater-tests" depends="block-anteater-tests">
<property name="host" value="localhost"/>
<property name="port" value="8888"/>
<property name="base" value="/"/>
@@ -42,7 +42,7 @@
<jvmarg value="-Danteater.resources=${anteater.home}/resources"/>
<jvmarg
value="-Danteater.report=${anteater.home}/resources/scripts/report.xml"/>
<jvmarg value="-Djava.endorsed.dirs=${anteater.home}/lib"/>
- <arg line="-f src/test/anteater/all-tests.xml -Dhost=${host}
-Dport=${port} -Dbase=${base}"/>
+ <arg line="-f ${build.test}/anteater/all-tests.xml -Dhost=${host}
-Dport=${port} -Dbase=${base}"/>
</java>
</target>
@@ -56,3 +56,11 @@
</target>
+ <target name="block-anteater-tests" depends="prepare-blocks">
+
+ <ant antfile="${build.temp}/blocks-build.xml"
+ inheritAll="true"
+ inheritRefs="false"
+ target="prepare-anteater-tests"/>
+
+ </target>
1.4 +6 -14 cocoon-2.1/src/test/anteater/all-tests.xml
Index: all-tests.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/test/anteater/all-tests.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- all-tests.xml 31 Aug 2003 16:32:34 -0000 1.3
+++ all-tests.xml 11 Sep 2003 22:55:56 -0000 1.4
@@ -10,12 +10,11 @@
Description:
- To write a new Anteater test, just create a new Ant XML file and
- define a target whose name is the same as the filename, except for
- the .xml suffix. Then go in the top level directory of Cocoon and
+ To write a new Anteater test, just create a new Ant XML file with
+ a default target. Then go in the top level directory of Cocoon and
type:
- ./build.sh test
+ ./build.sh anteater-tests
The newly added test file will be picked up and executed
auto-magically.
@@ -29,16 +28,9 @@
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<target name="init">
- <property name="port" value="8100"/>
<property name="cocoon" value="http://${host}:${port}/${base}"/>
- <property name="src-webapp-dir" value="../../webapp"/>
- <property name="deploy-dir" value="../../../build/webapp"/>
- </target>
-
- <target name="deploy">
- <servletContainer port="${port}"/>
- <deploy path="/cocoon" webapp="${deploy-dir}"/>
- <sleep seconds="5"/>
+ <property name="src-webapp-dir" value="../../../../src/webapp"/>
+ <property name="deploy-dir" value="../../../../build/webapp"/>
</target>
<target name="all" depends="init">
@@ -53,6 +45,6 @@
<target name="runtest" depends="init">
<basename property="target" file="${name}" suffix=".xml"/>
<echo message="running test ${target} in dir ${basedir}"/>
- <ant antfile="${target}.xml" dir="${basedir}" target="${target}"
inheritAll="yes"/>
+ <ant antfile="${target}.xml" dir="${basedir}" inheritAll="yes"/>
</target>
</project>
1.34 +24 -0 cocoon-2.1/tools/src/blocks-build.xsl
Index: blocks-build.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/src/blocks-build.xsl,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- blocks-build.xsl 8 Sep 2003 22:25:27 -0000 1.33
+++ blocks-build.xsl 11 Sep 2003 22:55:56 -0000 1.34
@@ -103,6 +103,16 @@
</xsl:attribute>
</target>
+ <target name="prepare-anteater-tests">
+ <xsl:attribute name="depends">
+ <xsl:text>init</xsl:text>
+ <xsl:for-each select="$cocoon-blocks">
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="concat(@name, '-prepare-anteater-tests')"/>
+ </xsl:for-each>
+ </xsl:attribute>
+ </target>
+
<!-- Check if javadocs have to be generated -->
<target name="javadocs-check">
<mkdir dir="{string('${build.javadocs}')}"/>
@@ -528,6 +538,20 @@
</fileset>
</batchtest>
</junit>
+ </target>
+ <target name="[EMAIL PROTECTED]"
unless="unless.exclude.block.{$block-name}">
+
+ <!-- Test if this block has Anteater tests -->
+ <available property="{$block-name}.has.anteater-tests"
file="{string('${blocks}')}/{$block-name}/test/anteater"/>
+
+ <antcall target="{$block-name}-prepare-anteater-tests"/>
+ </target>
+
+ <target name="{$block-name}-prepare-anteater-tests"
if="{$block-name}.has.anteater-tests">
+ <copy todir="{string('${build.test}')}/anteater">
+ <fileset dir="{string('${blocks}')}/{$block-name}/test/anteater"/>
+ <mapper type="glob" from="*.xml" to="{$block-name}-*.xml"/>
+ </copy>
</target>
</xsl:template>
</xsl:stylesheet>