Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
The Ant build.xml file in this directory compiles all db Java sources (except
examples), runs the test suite using Clover to instrument the sources, and then
generates the Clover coverage reports.
You must place clover.jar in your Ant lib directory as well as placing
clover.jar and velocity.jar in this directory. (Using a classpathref in the
Ant javac task doesn't seem to work.)
$ cp <YOUR-CLOVER-INSTALL>/clover.jar .
$ cp <YOUR-CLOVER-INSTALL>/velocity.jar .
$ cp clover.jar <YOUR-ANT-DIRECTORY>/lib
$ ant all
'ant all' will delete all output files, compile and run the tests, and then
generate the reports.
'ant' will compile sources that need compiling and run the tests to collect
coverage information.
'ant report' will generate the reports against the current coverage database.
The build.xml file works when run from db/test/scr024/coverage but it should
also work when run from a build directory copied by the TCL test harness, e.g.,
db/build_unix/TESTDIR/coverage.

View File

@@ -0,0 +1,233 @@
<!-- $Id: build.xml 63573 2008-05-23 21:43:21Z trent.nelson $ -->
<project name="clover" default="build" basedir=".">
<property name="db" location="../../.."/>
<property name="src" location="${db}/java/src"/>
<property name="test.src" location="${db}/test/scr024/src"/>
<property name="examples.src" location="${db}/examples_java/src"/>
<property name="testserialdir" value="testserial"/>
<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"/>
</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="classes"/>
<path refid="clover.classpath"/>
</path>
<target name="build" depends="init">
<javac destdir="classes" debug="on" source="1.5" target="1.5">
<src path="${src}"/>
<src path="${test.src}"/>
<src path="${examples.src}"/>
<exclude name="com/sleepycat/**/release/**"/>
<exclude name="com/sleepycat/xa/**"/>
</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.5" target="1.5"
includeAntRuntime="true" srcdir="${testserialdir}">
<include name="${testserialpath}.java"/>
</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.5" target="1.5" classpath="classes">
<src path="testevolvedir"/>
</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">
<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">
<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">
<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>
<target name="testevolve" depends="build">
</target>
<target name="examples" depends="build">
<echo message="=== HelloDatabaseWorld ==="/>
<java dir="." fork="yes" classpathref="classpath"
classname="collections.hello.HelloDatabaseWorld"/>
<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>
</target>
<target name="one_shipment_example">
<echo message="=== ${param_name} ==="/>
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<java dir="." fork="yes" classpathref="classpath"
classname="collections.ship.${param_name}.Sample"/>
</target>
<target name="one_persist_example">
<echo message="=== ${param_name} ==="/>
<delete dir="tmp"/>
<mkdir dir="tmp"/>
<java fork="yes" dir="." classname="persist.${param_name}">
<jvmarg value="-ea"/>
<arg line="-h tmp"/>
<classpath refid="classpath"/>
</java>
</target>
<target name="DplDump">
<echo message="=== DplDump ${home} ${store} ==="/>
<java fork="yes" dir="." classname="persist.DplDump">
<jvmarg value="-ea"/>
<arg line="-h ${home} -s ${store}"/>
<classpath refid="classpath"/>
</java>
</target>
<!-- Using fork="yes" does not work for AccessExample, apparently because
it is interactive and the input stream of the forked process isn't
functional; therefore this sample writes to the base directory.
-->
<target name="access_example" depends="build">
<echo message="=== AccessExample ==="/>
<java classpathref="classpath"
classname="collections.access.AccessExample">
</java>
</target>
<target name="report">
<java classname="com.cortexeb.tools.clover.reporters.html.HtmlReporter"
fork="true">
<arg line="--outputdir reports --showSrc --initstring ${clover.initstring} --title 'Berkeley DB Java BDB API'"/>
<classpath refid="clover.classpath"/>
</java>
</target>
</project>