| <?xml version="1.0"?> |
| <!-- $Id$ --> |
| <project name="Tapestry Framework JUnit Test Suite" default="run"> |
| |
| <property name="root.dir" value="../"/> |
| |
| <property file="${root.dir}/config/Version.properties"/> |
| <property file="${root.dir}/config/build.properties"/> |
| <property file="${root.dir}/config/common.properties"/> |
| |
| |
| <property name="framework.src.dir" value="${root.dir}/framework/src"/> |
| <property name="clover-classes.dir" value=".clover-classes"/> |
| <property name="clover-db.dir" value=".clover-db"/> |
| <property name="clover.initstring" location="${clover-db.dir}/clover_db"/> |
| |
| <property name="clover.report.dir" value="../web/doc/clover"/> |
| |
| <property name="local.lib.dir" value="lib"/> |
| |
| <property name="jdom.jar" value="jdom-b8.jar"/> |
| |
| <path id="compile-tests.class.path"> |
| <pathelement location="${framework.jar}"/> |
| <path refid="base.class.path"/> |
| </path> |
| |
| <path id="base.class.path"> |
| <pathelement location="${lib.ext.dir}/ejb.jar"/> |
| <pathelement location="${lib.ext.dir}/javax.servlet.jar"/> |
| <pathelement location="${lib.ext.dir}/${commons-logging.jar}"/> |
| <pathelement location="${lib.ext.dir}/${commons-lang.jar}"/> |
| <pathelement location="${lib.ext.dir}/javax.xml.jaxp.jar"/> |
| <pathelement location="${lib.ext.dir}/org.apache.crimson.jar"/> |
| <pathelement location="${lib.ext.dir}/junit.jar"/> |
| <pathelement location="${lib.ext.dir}/${jakarta-oro.jar}"/> |
| <pathelement location="${lib.ext.dir}/${ognl.jar}"/> |
| <pathelement location="${local.lib.dir}/${jdom.jar}"/> |
| </path> |
| |
| <target name="init"> |
| <mkdir dir="${classes.dir}"/> |
| </target> |
| |
| <target name="clean"> |
| <delete dir="${classes.dir}" quiet="true"/> |
| <delete dir="${clover-classes.dir}" quiet="true"/> |
| <delete dir="${clover-db.dir}" quiet="true"/> |
| </target> |
| |
| <target name="compile" depends="init" description="Compile all test classes."> |
| <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on" target="1.1"> |
| <classpath refid="compile-tests.class.path"/> |
| </javac> |
| </target> |
| |
| <path id="junit.class.path"> |
| <path location="${classes.dir}"/> |
| <!-- Add the src directory back in, since package resources needed by |
| the tests are there. Also, ensure that the local copy |
| of junit/running/excluded.properties overrides the default |
| copy in junit.jar --> |
| <path location="${src.dir}"/> |
| <path refid="compile-tests.class.path"/> |
| <path location="${lib.ext.dir}/${log4j.jar}"/> |
| </path> |
| |
| <target name="run" depends="compile" description="Run the test suite."> |
| <java fork="true" classname="junit.textui.TestRunner" |
| failonerror="true"> |
| <classpath refid="junit.class.path"/> |
| <arg value="net.sf.tapestry.junit.TapestrySuite"/> |
| </java> |
| </target> |
| |
| <target name="gui" depends="compile" description="Run the JUnit GUI."> |
| <java fork="true" classname="junit.swingui.TestRunner"> |
| <classpath refid="junit.class.path"/> |
| <arg value="net.sf.tapestry.junit.TapestrySuite"/> |
| </java> |
| |
| </target> |
| |
| |
| <path id="clover.class.path"> |
| <pathelement location="${clover-classes.dir}"/> |
| <pathelement location="${clover.dir}/lib/clover.jar"/> |
| <path refid="junit.class.path"/> |
| </path> |
| |
| <target name="clover" depends="compile" description="Run tests and construct Clover report."> |
| <mkdir dir="${clover-classes.dir}"/> |
| <mkdir dir="${clover-db.dir}"/> |
| |
| <property name="build.compiler" |
| value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/> |
| |
| <javac srcdir="${framework.src.dir}" destdir="${clover-classes.dir}" debug="on" target="1.1"> |
| <classpath refid="base.class.path"/> |
| </javac> |
| |
| |
| <echo>Clover Run #1: No logging enabled ...</echo> |
| |
| <java fork="true" classname="junit.textui.TestRunner" |
| failonerror="true"> |
| <classpath refid="clover.class.path"/> |
| <arg value="net.sf.tapestry.junit.TapestrySuite"/> |
| </java> |
| |
| |
| <echo>Clover Run #2: All logging enabled ...</echo> |
| |
| <java fork="true" classname="junit.textui.TestRunner" |
| failonerror="true"> |
| <classpath refid="clover.class.path"/> |
| <arg value="net.sf.tapestry.junit.TapestrySuite"/> |
| <sysproperty key="log4j.configuration" value="log4j-slow.properties"/> |
| </java> |
| |
| <antcall target="clover-report"/> |
| </target> |
| |
| <target name="clover-report"> |
| <mkdir dir="${clover.report.dir}"/> |
| |
| <java |
| classname="com.cortexeb.tools.clover.reporters.html.HtmlReporter" |
| fork="true"> |
| <classpath> |
| <pathelement location="${clover.dir}/lib/clover.jar"/> |
| <pathelement location="${clover.dir}/lib/velocity.jar"/> |
| </classpath> |
| <arg line="--outputdir ${clover.report.dir}"/> |
| <arg line="--showSrc"/> |
| <arg line="--initstring ${clover.initstring}"/> |
| <arg line="--title 'Release ${framework.version}'"/> |
| </java> |
| |
| </target> |
| |
| </project> |
| |