vitro/utilities/testrunner/build.xml

137 lines
4.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!-- ======================================================================
Build script for the Selenium test runner.
====================================================================== -->
<project name="acceptanceTests" default="describe" basedir=".">
<property name="source.dir" location="${basedir}/src" />
<property name="lib.dir" location="${basedir}/lib" />
<property name="test.dir" location="${basedir}/test" />
<property name="build.dir" value="${basedir}/.build" />
<!-- =================================
target: describe
================================= -->
<target name="describe" description="--> Describe the targets (this is the default).">
<echo>
all - Runs "clean", then "run".
clean - Delete all artifacts so the next build will be from scratch.
compile - Compile the Java source files.
test - Compile and run the JUnit tests.
run - Run the tester.
</echo>
</target>
<!-- =================================
target: all
================================= -->
<target name="all"
depends="clean, run"
description="--> Do a clean build and execute the selenium runner.">
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" description="--> Remove any artifacts from previous builds.">
<delete dir="${build.dir}" />
</target>
<!-- - - - - - - - - - - - - - - - - -
target: prepare
- - - - - - - - - - - - - - - - - -->
<target name="prepare">
<mkdir dir="${build.dir}" />
</target>
<!-- =================================
target: compile
================================= -->
<target name="compile" depends="prepare" description="--> Compile the selenium runner.">
<javac srcdir="${source.dir}"
destdir="${build.dir}"
debug="true"
deprecation="true"
encoding="UTF8"
optimize="true"
source="1.6">
<classpath>
<pathelement location="${lib.dir}/commons-httpclient-3.1.jar" />
</classpath>
</javac>
</target>
<!-- =================================
target: test
================================= -->
<target name="test"
depends="compile"
description="--> Run unit tests against the selenium runner code.">
<javac srcdir="${test.dir}"
destdir="${build.dir}"
debug="true"
deprecation="true"
encoding="UTF8"
optimize="false"
source="1.6">
<classpath>
<pathelement location="${build.dir}" />
<pathelement location="${lib.dir}/junit-4.8.1.jar" />
</classpath>
</javac>
<junit printsummary="no" haltonfailure="yes">
<classpath>
<pathelement location="${build.dir}" />
<pathelement location="${lib.dir}/junit-4.8.1.jar" />
</classpath>
<formatter type="brief" />
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="test">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- =================================
target: run
================================= -->
<target name="run" depends="test" description="--> Execute the selenium runner.">
<property name="acceptance.dir" location="${basedir}" />
<property name="acceptance.properties.file"
location="${acceptance.dir}/acceptance_tests.properties" />
<condition property="acceptance.interactive.arg" value="interactive" else="">
<not>
<istrue value="${acceptance.batch}" />
</not>
</condition>
<java classname="edu.cornell.mannlib.vitro.utilities.testrunner.SeleniumRunner"
fork="yes"
dir="${acceptance.dir}"
failonerror="true">
<classpath>
<pathelement location="${build.dir}" />
<pathelement location="${source.dir}" />
<pathelement location="${lib.dir}/commons-httpclient-3.1.jar" />
<pathelement location="${lib.dir}/commons-logging-1.1.1.jar" />
<pathelement location="${lib.dir}/commons-codec-1.3.jar" />
</classpath>
<arg file="${acceptance.properties.file}" />
<arg value="${acceptance.interactive.arg}" />
</java>
</target>
</project>