Files
Yasuhiro KIMURA 9678929700 Update to 18.1.40
2020-07-24 01:10:28 +09:00

329 lines
11 KiB
XML

<!-- $Id$ -->
<project name="clover" default="build" basedir=".">
<property name="db" location="../../.."/>
<property name="db.jar" location="${db}/build_unix/db.jar"/>
<property name="test.src" location="src"/>
<property name="examples.src" location="${db}/examples/java/src"/>
<property name="clover.initstring" location="reports/clover.db"/>
<property name="clover.excludes" value="**/test/** collections/** db/** com/sleepycat/db/**"/>
<!--
<property name="build.compiler"
value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
-->
<target name="all" depends="clean,test,report"/>
<target name="clean">
<delete dir="classes"/>
<delete dir="tmp"/>
<delete dir="reports"/>
<delete dir="original"/>
<delete dir="evolved"/>
<delete dir="testevolvedir"/>
<delete dir="testserialdir"/>
<delete dir="testenhancedir"/>
</target>
<target name="init">
<mkdir dir="classes"/>
<mkdir dir="tmp"/>
<mkdir dir="reports"/>
</target>
<path id="clover.classpath">
<pathelement location="clover.jar"/>
<pathelement location="velocity.jar"/>
</path>
<path id="classpath">
<pathelement location="${db.jar}"/>
<pathelement location="classes"/>
<pathelement location="clover.jar"/>
<path refid="clover.classpath"/>
</path>
<path id="enhanced.classpath">
<pathelement location="${db.jar}"/>
<pathelement location="testenhancedir"/>
</path>
<target name="build" depends="init">
<echo message="Using db.jar: ${db.jar}"/>
<javac destdir="classes" debug="on" source="1.7" target="1.7">
<classpath refid="classpath"/>
<src path="${test.src}"/>
<src path="${examples.src}"/>
<exclude name="com/sleepycat/**/release/**"/>
</javac>
<!-- Compile original version of TestSerial.java.original. -->
<property name="testserialpath"
value="com/sleepycat/collections/test/serial/TestSerial"/>
<copy file="${test.src}/${testserialpath}.java.original"
tofile="testserialdir/${testserialpath}.java"/>
<javac destdir="testserialdir" debug="on" source="1.7" target="1.7"
includeAntRuntime="true" srcdir="testserialdir">
<include name="${testserialpath}.java"/>
<classpath refid="classpath"/>
</javac>
<!-- Compile original version of EvolveClasses. -->
<copy file=
"${test.src}/com/sleepycat/persist/test/EvolveClasses.java.original"
tofile=
"testevolvedir/com/sleepycat/persist/test/EvolveClasses.java"/>
<copy file=
"${test.src}/com/sleepycat/persist/test/EvolveCase.java"
tofile=
"testevolvedir/com/sleepycat/persist/test/EvolveCase.java"/>
<copy file=
"${test.src}/com/sleepycat/persist/test/PersistTestUtils.java"
tofile=
"testevolvedir/com/sleepycat/persist/test/PersistTestUtils.java"/>
<javac debug="on" source="1.7" target="1.7">
<src path="testevolvedir"/>
<classpath refid="classpath"/>
</javac>
</target>
<target name="test" depends="build">
<!-- Determine which tests to run. -->
<condition property="dotestserial">
<or>
<not><isset property="testcase"/></not>
<equals arg1="${testcase}" arg2=
"com.sleepycat.collections.test.serial.StoredClassCatalogTest"/>
</or>
</condition>
<condition property="dotestevolve">
<or>
<not><isset property="testcase"/></not>
<equals arg1="${testcase}"
arg2="com.sleepycat.persist.test.EvolveTest"/>
</or>
</condition>
<!-- Performs initialization needed before StoredClassCatalogTest. -->
<junit fork="yes" dir="." printsummary="on" haltonfailure="on"
showoutput="on" clonevm="true">
<jvmarg value="-ea"/>
<classpath path="testserialdir"/> <!-- Must be first -->
<classpath refid="classpath"/>
<sysproperty key="testdestdir" value="./tmp"/>
<sysproperty key="longtest" value="${longtest}"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<test name=
"com.sleepycat.collections.test.serial.StoredClassCatalogTestInit"
todir="reports" if="dotestserial"/>
</junit>
<!-- Performs initialization needed before persist EvolveTest. -->
<junit fork="yes" dir="." printsummary="on" haltonfailure="on"
showoutput="on" clonevm="true">
<jvmarg value="-ea"/>
<classpath path="testevolvedir"/>
<classpath refid="classpath"/>
<sysproperty key="testdestdir" value="./tmp"/>
<sysproperty key="longtest" value="${longtest}"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<test name="com.sleepycat.persist.test.EvolveTestInit"
todir="reports" if="dotestevolve"/>
</junit>
<!-- Performs testcase if set, or batch tests. -->
<junit fork="yes" dir="." printsummary="on" haltonfailure="on"
showoutput="on" clonevm="true">
<jvmarg value="-ea"/>
<classpath refid="classpath"/>
<sysproperty key="testdestdir" value="./tmp"/>
<sysproperty key="longtest" value="${longtest}"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<test name="${testcase}" todir="reports" if="testcase"/>
<batchtest todir="reports" unless="testcase">
<fileset dir="classes" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<!-- examples runs all examples, but does not include access_example because
it is interactive.
-->
<target name="examples" depends="build">
<echo message="=== HelloDatabaseWorld ==="/>
<java dir="." fork="yes" classpathref="classpath" failonerror="true"
classname="collections.hello.HelloDatabaseWorld" clonevm="true"/>
<echo message=""/>
<antcall target="one_shipment_example">
<param name="param_name" value="basic"/>
</antcall>
<antcall target="one_shipment_example">
<param name="param_name" value="index"/>
</antcall>
<antcall target="one_shipment_example">
<param name="param_name" value="entity"/>
</antcall>
<antcall target="one_shipment_example">
<param name="param_name" value="tuple"/>
</antcall>
<antcall target="one_shipment_example">
<param name="param_name" value="sentity"/>
</antcall>
<antcall target="one_shipment_example">
<param name="param_name" value="marshal"/>
</antcall>
<antcall target="one_shipment_example">
<param name="param_name" value="factory"/>
</antcall>
<antcall target="one_persist_example">
<param name="param_name" value="CustomKeyOrderExample"/>
</antcall>
<antcall target="one_persist_example">
<param name="param_name" value="EventExample"/>
</antcall>
<antcall target="one_persist_example">
<param name="param_name" value="EventExampleDPL"/>
</antcall>
<antcall target="one_persist_example">
<param name="param_name" value="PersonExample"/>
</antcall>
<antcall target="DplDump">
<param name="home" value="tmp"/>
<param name="store" value="PersonStore"/>
</antcall>
<antcall target="db-gettingStarted"/>
<antcall target="db-txn"/>
<antcall target="persist-gettingStarted"/>
<antcall target="persist-txn"/>
</target>
<target name="one_shipment_example">
<echo message="=== ${param_name} ==="/>
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<java dir="." fork="yes" classpathref="classpath" failonerror="true"
classname="collections.ship.${param_name}.Sample" clonevm="true"/>
</target>
<target name="one_persist_example">
<echo message="=== ${param_name} ==="/>
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<java fork="yes" dir="." classname="persist.${param_name}"
failonerror="true" clonevm="true">
<jvmarg value="-ea"/>
<arg line="-h tmp"/>
<classpath refid="classpath"/>
</java>
</target>
<!--
Before running this example, first run another DPL example that writes to the
home directory. Note that we do not clear the home directory here, in order
to use the DB in the home directory from a previous run.
-->
<target name="DplDump">
<echo message="=== DplDump ${home} ${store} ==="/>
<java fork="yes" dir="." classname="persist.DplDump" failonerror="true"
clonevm="true">
<jvmarg value="-ea"/>
<arg line="-h ${home} -s ${store}"/>
<classpath refid="classpath"/>
</java>
</target>
<target name="access_example" depends="build">
<echo message="=== AccessExample ==="/>
<java fork="yes" dir="." classpathref="classpath" failonerror="true"
classname="collections.access.AccessExample" clonevm="true">
</java>
</target>
<!-- Test GSG examples -->
<target name="db-gettingStarted" depends="build">
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<copy todir="tmp">
<fileset dir="${examples.src}/db/GettingStarted">
<include name="*.txt"/>
<exclude name="*.java"/>
</fileset>
</copy>
<java fork="yes" dir="tmp"
classname="db.GettingStarted.ExampleDatabaseLoad"
failonerror="true" clonevm="true">
<arg line="-h ."/>
<classpath refid="classpath"/>
</java>
<java fork="yes" dir="tmp"
classname="db.GettingStarted.ExampleDatabaseRead"
failonerror="true" clonevm="true">
<arg line="-h ."/>
<classpath refid="classpath"/>
</java>
<delete file="tmp/inventory.txt"/>
<delete file="tmp/vendors.txt"/>
</target>
<target name="db-txn" depends="build">
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<java fork="yes" dir="."
classname="db.txn.TxnGuide"
failonerror="true" clonevm="true">
<arg line="-h tmp"/>
<classpath refid="classpath"/>
</java>
</target>
<target name="persist-gettingStarted" depends="build">
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<mkdir dir="tmp/JEDB"/>
<copy todir="tmp">
<fileset dir="${examples.src}/persist/gettingStarted">
<include name="*.txt"/>
<exclude name="*.java"/>
</fileset>
</copy>
<java fork="yes" dir="tmp"
classname="persist.gettingStarted.SimpleStorePut"
failonerror="true" clonevm="true">
<arg line="-h ."/>
<classpath refid="classpath"/>
</java>
<java fork="yes" dir="tmp"
classname="persist.gettingStarted.SimpleStoreGet"
failonerror="true" clonevm="true">
<arg line="-h ."/>
<classpath refid="classpath"/>
</java>
<delete file="tmp/inventory.txt"/>
<delete file="tmp/vendors.txt"/>
</target>
<target name="persist-txn" depends="build">
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<java fork="yes" dir="."
classname="persist.txn.TxnGuideDPL"
failonerror="true" clonevm="true">
<arg line="-h tmp"/>
<classpath refid="classpath"/>
</java>
</target>
<target name="report">
<java classname="com.cortexeb.tools.clover.reporters.html.HtmlReporter"
failonerror="true" fork="true" clonevm="true">
<arg line="--outputdir reports --showSrc --initstring ${clover.initstring} --title 'Berkeley DB Java BDB API'"/>
<classpath refid="clover.classpath"/>
</java>
</target>
</project>