vmassol 2003/03/23 13:27:18
Modified: integration/ant/src/scripts/share build-share.xml
Log:
Added support for swing test runner
Revision Changes Path
1.9 +79 -27 jakarta-cactus/integration/ant/src/scripts/share/build-share.xml
Index: build-share.xml
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/scripts/share/build-share.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- build-share.xml 23 Mar 2003 15:23:45 -0000 1.8
+++ build-share.xml 23 Mar 2003 21:27:18 -0000 1.9
@@ -31,7 +31,11 @@
<!-- Decides whether to halt the build on error and/or on failure -->
<property name="cactus.halt.on.failure" value="true"/>
<property name="cactus.halt.on.error" value="true"/>
-
+
+ <!-- JUnit Runner to use for executing the tests. Valid values are
+ "text" and "swing" -->
+ <property name="cactus.runner" value="text"/>
+
<!--
========================================================================
Set the properties related to the source tree.
@@ -189,6 +193,48 @@
<!-- Create the test report directory before running the tests -->
<mkdir dir="${cactus.reports.dir}"/>
+ <!-- Call the correct test runner -->
+ <antcall target="cactus.test.${cactus.runner}" inheritRefs="true"/>
+
+ <!-- Decides whether to halt the build if errors or failures have
+ occurred -->
+
+ <condition property="cactus.test.error.shouldstop">
+ <and>
+ <isset property="cactus.junit.error"/>
+ <equals arg1="${cactus.halt.on.error}" arg2="true" trim="true"
+ casesensitive="false"/>
+ </and>
+ </condition>
+ <antcall target="cactus.test.check.error"/>
+
+ <condition property="cactus.test.failure.shouldstop">
+ <and>
+ <isset property="cactus.junit.failure"/>
+ <equals arg1="${cactus.halt.on.failure}" arg2="true" trim="true"
+ casesensitive="false"/>
+ </and>
+ </condition>
+ <antcall target="cactus.test.check.failure"/>
+
+ </target>
+
+ <target name="cactus.test.check.error" if="cactus.test.error.shouldstop">
+ <fail>There were test errors</fail>
+ </target>
+
+ <target name="cactus.test.check.failure"
+ if="cactus.test.failure.shouldstop">
+ <fail>There were test failures</fail>
+ </target>
+
+ <!--
+ ========================================================================
+ Run the Cactus tests using the JUnit text runner.
+ ========================================================================
+ -->
+ <target name="cactus.test.text">
+
<junit printsummary="yes" failureproperty="cactus.junit.failure"
errorproperty="cactus.junit.error" fork="yes">
@@ -226,38 +272,44 @@
</junit>
- <!-- Decides whether to halt the build if errors or failures have
- occurred -->
+ </target>
- <condition property="cactus.test.error.shouldstop">
- <and>
- <isset property="cactus.junit.error"/>
- <equals arg1="${cactus.halt.on.error}" arg2="true" trim="true"
- casesensitive="false"/>
- </and>
- </condition>
- <antcall target="cactus.test.check.error"/>
+ <!--
+ ========================================================================
+ Run the Cactus tests using the JUnit swing runner.
+ ========================================================================
+ -->
+ <target name="cactus.test.swing">
- <condition property="cactus.test.failure.shouldstop">
- <and>
- <isset property="cactus.junit.failure"/>
- <equals arg1="${cactus.halt.on.failure}" arg2="true" trim="true"
- casesensitive="false"/>
- </and>
- </condition>
- <antcall target="cactus.test.check.failure"/>
+ <java classname="junit.swingui.TestRunner" fork="yes">
- </target>
+ <jvmarg
value="-Dcactus.contextURL=http://localhost:${cactus.port}/${cactus.context}"/>
- <target name="cactus.test.check.error" if="cactus.test.error.shouldstop">
- <fail>There were test errors</fail>
- </target>
+ <!-- This is needed to override the default mapping which is
+ "/FilterRedirector". The reason is that in web.xml we have
+ mapped the filter redirector to "test/filterRedirector.jsp"
+ as some containers do not support mapping to a directory -->
+ <jvmarg
value="-Dcactus.filterRedirectorName=test/filterRedirector.jsp"/>
+
+ <classpath>
+ <pathelement location="${cactus.target.conf.dir}"/>
+ <pathelement location="${cactus.target.classes.dir}"/>
+ <pathelement location="${cactus.framework.jar}"/>
+ <pathelement location="${cactus.log4j.jar}"/>
+ <pathelement location="${cactus.aspectjrt.jar}"/>
+ <pathelement location="${cactus.commons.logging.jar}"/>
+ <pathelement location="${cactus.junit.jar}"/>
+ <pathelement location="${cactus.commons.httpclient.jar}"/>
+ <pathelement location="${cactus.httpunit.jar}"/>
+ <path refid="cactus.classpath"/>
+ </classpath>
+
+ <arg value="-noloading"/>
+
+ </java>
- <target name="cactus.test.check.failure"
- if="cactus.test.failure.shouldstop">
- <fail>There were test failures</fail>
</target>
-
+
<!--
========================================================================
Clean generated files (including distributables)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]