blob: adb4fb5e00b884018564125768ac9cd7054e0481 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project name="hsqldb.test.suite"
default="run.test.suite"
basedir="..">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- B U I L D T I M E S T A M P -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<tstamp>
<format property="_tmpstamp"
pattern="yyyy/MM/dd-hh:mm:ss"
locale="en"/>
</tstamp>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- U S E R B U I L D P R O P E R T I E S O V E R R I D E S -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property file="${basedir}/build/build.properties"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- D E F A U L T B U I L D P R O P E R T I E S -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property name="test.suite.version"
value="1.9.0"/>
<property name="test.suite.title"
value="HSQLDB Test Suite"/>
<property name="test.suite.vendor"
value="The HSQL Development Group"/>
<property name="test.suite.implementation.title"
value="JDBC 4 Test Cases and Utilities"/>
<property name="test.suite.implementation.label"
value="private-${_tmpstamp}"/>
<property name="test.suite.implementation.vendor"
value="${user.name}"/>
<property name="sqltool.jar"
value="${basedir}/lib/sqltool.jar" />
<property name="hsqldb.jar"
value="${basedir}/lib/hsqldb.jar" />
<property name="hsqldbtest.jar"
value="${basedir}/lib/hsqldbtest.jar" />
<property name="junit.jar"
value="${basedir}/lib/junit.jar" />
<property name="test.suite.jar"
value="${basedir}/lib/testsuite.jar" />
<property name="test.src.dir"
value="${basedir}/test-src" />
<property name="test.classes.dir"
value="${basedir}/test-classes" />
<property name="test.results.dir"
value="${basedir}/test-results" />
<property name="build.debug"
value="true" />
<property name="build.optimize"
value="false" />
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- B U I L D C L A S S P A T H -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<path id="test.suite.javac.classpath">
<pathelement location="${hsqldb.jar}"/>
<pathelement location="${sqltool.jar}"/>
<pathelement location="${junit.jar}" />
</path>
<path id="test.all.classpath">
<pathelement location="${hsqldbtest.jar}"/>
<pathelement location="${junit.jar}" />
</path>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- S H A R E D I N I T I A L I Z A T I O N -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="-init">
<available classname="java.net.IDN"
property="ant.java.iscjava16"/>
<fail unless='ant.java.iscjava16'
message="JDK must be 1.6 or greater"/>
<available file="${hsqldb.jar}"
type='file'
property="hsqldb.available"/>
<fail unless='hsqldb.available'
message="'hsqldb.jar' must reside at ${hsqldb.jar}"/>
<available file="${sqltool.jar}"
type='file'
property="sqltool.available"/>
<fail unless='sqltool.available'
message="'sqltool.jar' must reside at ${sqltool.jar}"/>
<available file="${junit.jar}"
type='file'
property="junit.available"/>
<fail unless='junit.available'
message="'junit.jar' must reside at ${junit.jar}"/>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- M A K E T E S T S U I T E -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="make.test.suite"
description="Builds test classes and creates test suite jar"
depends="-init">
<mkdir dir="${test.classes.dir}"/>
<!-- Compile Classes -->
<javac srcdir="${test.src.dir}"
destdir="${test.classes.dir}"
debug="${build.debug}"
optimize="${build.optimize}"
>
<classpath refid="test.suite.javac.classpath"/>
<exclude name="**/TestWrapperInvocationHandler.java"/>
<!-- Temporarily excluding TestWrapperInvocationHandler until have
time to figure out how to resolve missing java.sql.* classes -->
<include name="**/*.java"/>
</javac>
<!-- Build Jar -->
<jar jarfile="${test.suite.jar}"
basedir="${test.classes.dir}">
<manifest>
<attribute name='Specification-Title'
value='${test.suite.title}'/>
<attribute name='Specification-Version'
value='${test.suite.version}'/>
<attribute name='Specification-Vendor'
value='${test.suite.vendor}'/>
<attribute name='Implementation-Title'
value='${test.suite.implementation.title}'/>
<attribute name='Implementation-Version'
value='${test.suite.implementation.label}'/>
<attribute name='Implementation-Vendor'
value='${test.suite.implementation.vendor}'/>
</manifest>
<include name="**/*"/>
</jar>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- R U N T E S T S U I T E -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="run.test.suite"
description="Runs the test suite and generates test result reports"
depends="-init">
<available file="${test.suite.jar}"
type='file'
property="test.suite.jar.available"/>
<fail unless='test.suite.jar.available'
message="The test suite jar must reside at ${test.suite.jar}"/>
<mkdir dir="${test.results.dir}"/>
<mkdir dir="${test.results.dir}/resources"/>
<mkdir dir="${test.results.dir}/resources/org"/>
<mkdir dir="${test.results.dir}/resources/org/hsqldb"/>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/util"/>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/util/preprocessor"/>
<copy todir="${test.results.dir}/resources/org/hsqldb/util/preprocessor">
<fileset dir="${test.src.dir}/org/hsqldb/util/preprocessor"
includes="*.exp"/>
</copy>
<copy todir="${test.results.dir}/resources/org/hsqldb/util/preprocessor">
<fileset dir="${test.src.dir}/org/hsqldb/util/preprocessor"
includes="*.inc"/>
</copy>
<copy todir="${test.results.dir}/resources/org/hsqldb/util/preprocessor">
<fileset dir="${test.src.dir}/org/hsqldb/util/preprocessor"
includes="*.src"/>
</copy>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/jdbc"/>
<copy todir="${test.results.dir}/resources/org/hsqldb/jdbc">
<fileset dir="${test.src.dir}/org/hsqldb/jdbc"
includes="*.sql"/>
</copy>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/jdbc/resources"/>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/jdbc/resources/xml"/>
<copy todir="${test.results.dir}/resources/org/hsqldb/jdbc/resources/xml">
<fileset dir="${test.src.dir}/org/hsqldb/jdbc/resources/xml"
includes="*.*"/>
</copy>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/jdbc/resources/sql"/>
<copy todir="${test.results.dir}/resources/org/hsqldb/jdbc/resources/sql">
<fileset dir="${test.src.dir}/org/hsqldb/jdbc/resources/sql"
includes="*.*"/>
</copy>
<mkdir dir="${test.results.dir}/resources/org/hsqldb/resources"/>
<copy todir="${test.results.dir}/resources/org/hsqldb/resources">
<fileset dir="${test.src.dir}/org/hsqldb/resources" includes="*.*"/>
</copy>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- U S E R T E S T P R O P E R T I E S -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Now using BundleHandler facility as primary properties loader, but -->
<!-- System properties still work (e.g. on command line -Dfoo=xyz or -->
<!-- using Ant to load properties files) and now take precedence over -->
<!-- bundle handler resources. -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- In this way, the bulk of the standard properties (that will probably -->
<!-- never need to be overriden) stay under the test source folder, hence -->
<!-- only specific property overrides need to be placed in the build -->
<!-- folder properties files or on the command line as -Dx=y directives. -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- The only (minor) disadvantage of this new scheme is that the bulk of -->
<!-- the test properties will no longer show up in the test report output -->
<!-- as environment settings -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property file="${basedir}/build/test.properties"/>
<property file="${basedir}/build/test.dbmd.convert.properties"/>
<!-- Execute JUNIT Tests -->
<junit showoutput="true"
fork="false"
failureproperty="tests.failed"
errorproperty="tests.failed" >
<batchtest todir="${test.results.dir}">
<fileset dir="${test.src.dir}"
includes="**/*Test.java"/>
</batchtest>
<classpath>
<pathelement location="${test.results.dir}/resources"/>
<path path="${hsqldb.jar}"/>
<path path="${junit.jar}"/>
<path path="${test.suite.jar}"/>
</classpath>
<syspropertyset id="test.suite.system.properties">
<propertyref prefix="hsqldb.test.suite."/>
</syspropertyset>
<formatter type="xml"/>
</junit>
<mkdir dir="${test.results.dir}/reports"/>
<mkdir dir="${test.results.dir}/reports/html"/>
<!-- Generate Test Reports -->
<junitreport todir="${test.results.dir}/reports">
<fileset dir="${test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="${test.results.dir}/reports/html"/>
</junitreport>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- R U N T E S T A L L -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="run.test.all"
description="Runs the org.hsqldb.test.TestAll set of tests.">
<available file="${hsqldbtest.jar}"
type='file'
property="hsqldbtest.jar.available"/>
<java classname="org.hsqldb.test.TestAll"
classpathref="test.all.classpath"
dir="${basedir}/testrun/hsqldb"
fork="true"/>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- C L E A N T E S T S U I T E -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="clean.test.suite"
description="Deletes compiled classes, test results and suite jar">
<delete dir="${test.classes.dir}" />
<delete dir="${test.results.dir}" />
<delete file="${test.suite.jar}" />
</target>
</project>