Author: hardy.ferentschik
Date: 2008-08-11 05:14:39 -0400 (Mon, 11 Aug 2008)
New Revision: 15025
Added:
annotations/trunk/lib/build/ant-contrib-1.0b2.jar
annotations/trunk/src/filters/
annotations/trunk/src/filters/db2.filter
annotations/trunk/src/filters/derby.filter
annotations/trunk/src/filters/hsqldb.filter
annotations/trunk/src/filters/mckoi.filter
annotations/trunk/src/filters/mssql.filter
annotations/trunk/src/filters/mysql.filter
annotations/trunk/src/filters/oracle.filter
annotations/trunk/src/filters/postgresql.filter
annotations/trunk/src/filters/sybase.filter
annotations/trunk/src/test-resources/
annotations/trunk/src/test-resources/ehcache.xml
annotations/trunk/src/test-resources/hibernate.properties
annotations/trunk/src/test-resources/log4j.properties
annotations/trunk/src/test/org/hibernate/test/annotations/RequiresDialect.java
Removed:
annotations/trunk/src/test/ehcache.xml
annotations/trunk/src/test/hibernate.properties
annotations/trunk/src/test/log4j.properties
Modified:
annotations/trunk/build.xml
annotations/trunk/common-build.xml
annotations/trunk/doc/reference/build.xml
annotations/trunk/src/test/org/hibernate/test/annotations/EntityTest.java
annotations/trunk/src/test/org/hibernate/test/annotations/TestCase.java
annotations/trunk/src/test/org/hibernate/test/annotations/access/AccessTest.java
annotations/trunk/src/test/org/hibernate/test/annotations/id/IdTest.java
annotations/trunk/src/test/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java
annotations/trunk/src/test/org/hibernate/test/annotations/join/JoinTest.java
annotations/trunk/src/test/org/hibernate/test/annotations/manytomany/ManyToManyTest.java
annotations/trunk/src/test/org/hibernate/test/annotations/onetomany/OneToManyTest.java
Log:
* Refactored the build files and updated common-build.xml. Also introduced the new ant
extension ant-contrib.
* Now the build can run against multiple databases using filters.
* Also introduced a new test annotation @RequiresDialect to mark a single test or whole
testclass specific for a given Dialect. We probably will need also @SkipForDialect. That
will come at a later stage.
Tests are passing now for hsqldb and mysql. More databases need to be tested.
Modified: annotations/trunk/build.xml
===================================================================
--- annotations/trunk/build.xml 2008-08-11 08:59:29 UTC (rev 15024)
+++ annotations/trunk/build.xml 2008-08-11 09:14:39 UTC (rev 15025)
@@ -7,13 +7,13 @@
-->
<project name="Hibernate Annotations" default="dist"
basedir="."
- xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
-
- <!-- Give user a chance to override without editing this file
- (and without typing -D each time it compiles it) -->
+ xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
<property file="build.properties"/>
<property file="${user.home}/.ant.properties"/>
-
+
<!-- Name of project and version, used to create filenames -->
<property name="Name" value="Hibernate Annotations"/>
<property name="name" value="hibernate-annotations"/>
@@ -21,86 +21,59 @@
<property name="javadoc.packagenames"
value="org.hibernate.*"/>
<property name="jdbc.dir" value="jdbc"/>
<property name="copy.test" value="true"/>
- <property name="javac.source" value="1.5"/>
- <property name="javac.target" value="1.5"/>
- <property name="common.dir" value="${basedir}"/>
-
- <!-- property name="jpa-api.jar"
value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/>
- <property name="commons-annotations.jar"
-
value="${basedir}/../commons-annotations/target/hibernate-commons-annotations/hibernate-commons-annotations.jar"/
-->
- <property name="ivy.dep.dir" value="${basedir}/build/lib"
/>
-
-
- <available property="jpa-present" file="${basedir}/../jpa-api"
type="dir"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
+ <property name="common.dir" value="${basedir}"/>
+ <property name="ivy.dep.dir" value="${basedir}/build/lib"/>
+
+ <available property="jpa-present" file="${basedir}/../jpa-api"
type="dir"/>
+ <property name="jpa-javadoc.dir"
value="${dist.doc.dir}/jpa-api"/>
+
<import file="${common.dir}/common-build.xml"/>
- <property name="jpa-javadoc.dir"
value="${dist.doc.dir}/jpa-api"/>
-
-
- <path id="lib.moduleclass.path">
- <!-- pathelement location="${jpa-api.jar}"/>
- <pathelement location="${commons-annotations.jar}"/ -->
- <fileset dir="${ivy.dep.dir}/core">
+
+ <path id="lib.moduleclass.path">
+ <fileset dir="${ivy.dep.dir}/core">
<include name="*.jar"/>
</fileset>
- </path>
-
+ <fileset dir="${common-build.basedir}/lib/build">
+ <!-- ${build.lib.dir} fails in reference doc build -->
+ <include name="junitext-*.jar"/>
+ </fileset>
+ </path>
+
<path id="junit.moduleclasspath">
<pathelement location="${src.dir}"/>
<pathelement location="${test.dir}"/>
- <pathelement
location="lib/testlibs/org.eclipse.jdt.core_3.1.0.jar"/>
<fileset dir="${jdbc.dir}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
- <fileset dir="${ivy.dep.dir}/test">
+ <fileset dir="${ivy.dep.dir}/test">
<include name="*.jar"/>
</fileset>
- </path>
-
- <target name="init">
+ </path>
+
+ <target name="init">
<antcall target="common-build.init"/>
- <tstamp>
- <format property="now" pattern="yyyyMMddhhmmss"/>
- </tstamp>
- <!-- available file="${jpa-api.jar}" type="file"
property="jpa-api.jar.available"/>
- <available file="${commons-annotations.jar}" type="file"
property="commons-annotations.jar.available"/ -->
- <mkdir dir="${ivy.dep.dir}/core"/>
- <mkdir dir="${ivy.dep.dir}/test"/>
- <ivy:configure file="${ivy.jar.dir}/ivyconf.xml" />
- </target>
-
- <!-- target name="get.jpa-api" depends="init"
unless="jpa-api.jar.available">
- <ant inheritall="false" dir="${basedir}/../jpa-api"
target="clean"/>
- <ant inheritall="false" dir="${basedir}/../jpa-api"
target="jar"/>
+ <tstamp>
+ <format property="now" pattern="yyyyMMddhhmmss"/>
+ </tstamp>
+ <mkdir dir="${ivy.dep.dir}/core"/>
+ <mkdir dir="${ivy.dep.dir}/test"/>
+ <ivy:configure file="${ivy.jar.dir}/ivyconf.xml"/>
</target>
-
- <target name="get.commons-annotations" depends="init"
unless="commons-annotations.jar.available">
- <ant inheritall="false" dir="${basedir}/../commons-annotations"
target="clean"/>
- <ant inheritall="false" dir="${basedir}/../commons-annotations"
target="jar"/>
- </target -->
-
- <target name="get.deps.core" depends="init"
description="retrieve the core dependencies">
- <ivy:resolve conf="default" />
- <ivy:retrieve pattern="${ivy.dep.dir}/core/[artifact].[ext]"
conf="default" />
- </target>
-
- <target name="compile" depends="init,get.deps.core"
- description="Compile the Java source code">
-
- <available
- classname="org.eclipse.core.launcher.Main"
- property="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"
- classpath="${java.class.path}"/>
- <javac
- srcdir="${src.dir}"
- destdir="${classes.dir}"
- classpathref="lib.class.path"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- nowarn="on"
- source="${javac.source}"
- target="${javac.target}">
+
+ <target name="compile" depends="init,get.deps.core"
+ description="Compile the Java source code">
+
+ <available classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac srcdir="${src.dir}" destdir="${classes.dir}"
+ classpathref="lib.class.path" debug="${javac.debug}"
+ optimize="${javac.optimize}" nowarn="on"
source="${javac.source}"
+ target="${javac.target}">
<src path="${src.dir}"/>
</javac>
<copy todir="${classes.dir}">
@@ -110,53 +83,85 @@
</fileset>
</copy>
</target>
-
- <target name="get.deps.test" depends="init"
description="retrieve the test dependencies">
- <ivy:resolve conf="test" />
- <ivy:retrieve pattern="${ivy.dep.dir}/test/[artifact].[ext]"
conf="test" />
- </target>
-
- <target name="compiletest" depends="compile,get.deps.test"
description="Compile the tests">
- <available
- classname="org.eclipse.core.launcher.Main"
- property="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"
- classpath="${java.class.path}"/>
- <javac
- destdir="${testclasses.dir}"
- classpathref="junit.classpath"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- nowarn="on"
- source="${javac.source}"
- target="${javac.target}">
+
+ <target name="compiletest" depends="compile,get.deps.test"
+ description="Compile the tests">
+ <available classname="org.eclipse.core.launcher.Main"
+ property="build.compiler"
+ value="org.eclipse.jdt.core.JDTCompilerAdapter"
+ classpath="${java.class.path}"/>
+ <javac destdir="${testclasses.dir}"
classpathref="junit.classpath"
+ debug="${javac.debug}" optimize="${javac.optimize}"
nowarn="on"
+ source="${javac.source}" target="${javac.target}">
<src refid="testsrc.path"/>
</javac>
</target>
-
- <target name="jar" depends="compile" description="Build the
distribution .jar file">
+
+ <target name="jar" depends="compile"
+ description="Build the distribution .jar file">
<mkdir dir="${classes.dir}/META-INF"/>
<manifest file="${classes.dir}/META-INF/MANIFEST.MF">
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version"
value="${version}"/>
- <attribute name="Implementation-Vendor"
value="hibernate.org"/>
- <attribute name="Implementation-Vendor-Id"
value="hibernate.org"/>
- <attribute name="Implementation-URL"
value="http://annotations.hibernate.org"/>
- <attribute name="Specification-Title" value="Java
Persistence"/>
+ <attribute name="Implementation-Vendor"
value="hibernate.org"/>
+ <attribute name="Implementation-Vendor-Id"
value="hibernate.org"/>
+ <attribute name="Implementation-URL"
+ value="http://annotations.hibernate.org"/>
+ <attribute name="Specification-Title" value="Java
Persistence"/>
<attribute name="Specification-Version" value="1.0"/>
- <attribute name="Specification-Vendor"
value="jcp.org"/>
- </manifest>
+ <attribute name="Specification-Vendor" value="jcp.org"/>
+ </manifest>
<antcall target="common-build.jar"/>
- <delete file="${dist.dir}/ivy.xml"/> <!-- delete last produced
ivy file to be sure a new one will be generated -->
- <ivy:resolve conf="default"/>
- <ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]"
- resolver="local"
- pubrevision="latest"
- pubdate="${now}"
- status="integration"
- />
- </target>
-
+ <delete file="${dist.dir}/ivy.xml"/>
+ <!-- delete last produced ivy file to be sure a new one will be generated -->
+ <ivy:resolve conf="default"/>
+ <ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]"
+ resolver="local" pubrevision="latest" pubdate="${now}"
+ status="integration"/>
+ </target>
+
+ <target name="junit" depends="compiletest">
+ <for list="${targetdb}" param="db">
+ <sequential>
+ <antcall target="test-resources">
+ <param name="db" value="@{db}"/>
+ </antcall>
+ <mkdir dir="${testreports.dir}/@{db}"/>
+ <echo>Running against db: @{db}</echo>
+ <junit printsummary="yes" haltonfailure="yes"
forkmode="once">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="${testreports.dir}/@{db}"
+ haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </sequential>
+ </for>
+ </target>
+
+ <!-- Run a single unit test. -->
+ <target name="junitsingle" depends="compiletest"
+ description="Run a single test suite (requires testname and jdbc.driver
properties)">
+ <for list="${targetdb}" param="db">
+ <sequential>
+ <antcall target="test-resources">
+ <param name="db" value="@{db}"/>
+ </antcall>
+ <mkdir dir="${testreports.dir}/@{db}"/>
+ <echo>Running against db: @{db}</echo>
+ <junit printsummary="yes" fork="yes"
haltonfailure="yes">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <test fork="yes" todir="${testreports.dir}/@{db}"
+ haltonfailure="no" name="${testname}"/>
+ </junit>
+ </sequential>
+ </for>
+ </target>
+
<target name="jpa-javadoc" if="jpa-present">
<mkdir dir="${jpa-javadoc.dir}"/>
<ant dir="../jpa-api" target="javadoc"
inheritAll="false"/>
@@ -166,51 +171,55 @@
</fileset>
</copy>
</target>
-
+
<!-- Some of this can probably be moved to common-build... -->
- <target name="dist"
depends="get.deps.core,get.deps.test,jar,javadoc,jpa-javadoc,copysource,copytest,copylib,extras"
- description="Build everything">
-
+ <target name="dist"
+ depends="get.deps.core,get.deps.test,jar,javadoc,jpa-javadoc,copysource,copytest,copylib,extras"
+ description="Build everything">
+
<ant inheritall="false" dir="${basedir}/doc/reference"/>
<copy todir="${dist.dir}/doc/reference" failonerror="false">
<fileset dir="${basedir}/doc/reference/build">
<include name="**/*.*"/>
</fileset>
</copy>
-
+
<copy todir="${dist.dir}" failonerror="false">
<fileset dir="${common.dir}">
<include name="common-build.xml"/>
</fileset>
</copy>
- <copy todir="${dist.dir}/ivy" failonerror="false">
- <fileset dir="${ivy.jar.dir}">
- <include name="**/*.*"/>
- </fileset>
- </copy>
-
- <!-- copy dependencies -->
- <copy todir="${dist.lib.dir}" failonerror="false">
+ <copy todir="${dist.dir}/ivy" failonerror="false">
+ <fileset dir="${ivy.jar.dir}">
+ <include name="**/*.*"/>
+ </fileset>
+ </copy>
+
+ <!-- copy dependencies -->
+ <copy todir="${dist.lib.dir}" failonerror="false">
<fileset dir="${ivy.dep.dir}/core">
- <include name="*.jar"/>
- </fileset>
- </copy>
- <mkdir dir="${dist.lib.dir}/test"/>
- <copy todir="${dist.lib.dir}/test"
failonerror="false">
+ <include name="*.jar"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.lib.dir}/test"/>
+ <copy todir="${dist.lib.dir}/test" failonerror="false">
<fileset dir="${ivy.dep.dir}/test">
- <include name="*.jar"/>
- </fileset>
- </copy>
-
- <!-- ivy uses the module name without hibernate- (to mimic the directory
names). Revert the situation -->
- <move file="${dist.lib.dir}/commons-annotations.jar"
tofile="${dist.lib.dir}/hibernate-commons-annotations.jar"
- failonerror="false"/>
-
- <copy file="${basedir}/build.properties.dist"
tofile="${dist.dir}/build.properties" failonerror="false">
+ <include name="*.jar"/>
+ </fileset>
</copy>
+
+
+ <!-- ivy uses the module name without hibernate- (to mimic the directory names).
Revert the situation -->
+ <move file="${dist.lib.dir}/commons-annotations.jar"
+ tofile="${dist.lib.dir}/hibernate-commons-annotations.jar"
+ failonerror="false"/>
+
+ <copy file="${basedir}/build.properties.dist"
+ tofile="${dist.dir}/build.properties" failonerror="false">
+ </copy>
<antcall target="common-build.dist"/>
</target>
-
+
<target name="zip-dist" description="zip the dist">
<zip zipfile="${dist.dir}-${version}.zip">
<zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
@@ -219,5 +228,5 @@
<tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
</tar>
</target>
-
+
</project>
Modified: annotations/trunk/common-build.xml
===================================================================
--- annotations/trunk/common-build.xml 2008-08-11 08:59:29 UTC (rev 15024)
+++ annotations/trunk/common-build.xml 2008-08-11 09:14:39 UTC (rev 15025)
@@ -1,277 +1,248 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="common-build" default="dist"
- xmlns:artifact="urn:maven-artifact-ant">
- <description>Common properties and targets for the HibernateExt
project</description>
-
- <!-- my.basedir property can be used to refer to files/directories relatively to the
common-build.xml file -->
- <dirname property="common-build.basedir"
file="${ant.file.common-build}"/>
-
- <!-- Give user a chance to override without editing this file
- (and without typing -D each time it compiles it) -->
- <property file="${common-build.basedir}/build.properties"/>
- <property file="${user.home}/.ant.properties"/>
-
- <property name="src.dir" location="src/java"/>
- <property name="test.dir" location="src/test"/>
- <property name="lib.dir" location="lib"/>
- <property name="build.dir" location="build"/>
- <property name="classes.dir"
location="${build.dir}/classes"/>
- <property name="testclasses.dir"
location="${build.dir}/testclasses"/>
- <property name="testreports.dir"
location="${build.dir}/test-reports"/>
- <property name="dist.target.dir" location="target"/>
- <property name="dist.dir"
location="${dist.target.dir}/${name}"/>
- <property name="instrumenttest.out.dir"
value="instrumenttestout"/>
- <property name="doc.dir" location="doc"/>
- <property name="doc.api.dir" location="${doc.dir}/api"/>
- <property name="doc.reference.dir"
location="${doc.dir}/reference"/>
-
- <property name="dist.doc.dir"
location="${dist.dir}/doc"/>
- <property name="dist.api.dir"
location="${dist.dir}/doc/api"/>
-
- <property name="dist.src.dir" location="${dist.dir}/src"/>
- <property name="dist.test.dir" location="${dist.dir}/test"/>
- <property name="dist.lib.dir" location="${dist.dir}/lib"/>
- <property name="jar.name" value="${name}"/>
- <property name="jar.file.name"
value="${dist.dir}/${jar.name}.jar"/>
- <property name="jartest.file.name"
value="${dist.dir}/${jar.name}-tests.jar"/>
-
- <property name="javadoc"
value="http://java.sun.com/j2se/1.4/docs/api"/>
- <property name="javac.debug" value="on"/>
- <property name="javac.optimize" value="off"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
-
- <property name="pom.file" value="pom.xml"/>
- <property name="src.jar" value="${build.dir}/src.jar"/>
-
+<project name="common-build" default="dist"
+ xmlns:artifact="urn:maven-artifact-ant"
xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+ <description>Common properties and targets for the HibernateExt
+ project</description>
+
+
+ <!-- my.basedir property can be used to refer to files/directories relatively to the
common-build.xml file -->
+ <dirname property="common-build.basedir"
file="${ant.file.common-build}"/>
+
+ <!-- Give user a chance to override without editing this file
+ (and without typing -D each time it compiles it) -->
+ <property file="${common-build.basedir}/build.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <property name="src.dir" location="src/java"/>
+ <property name="test.dir" location="src/test"/>
+ <property name="test.resources.dir"
location="src/test-resources"/>
+ <property name="filter.dir" location="src/filters"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="build.dir" location="build"/>
+ <property name="classes.dir"
location="${build.dir}/classes"/>
+ <property name="testclasses.dir"
location="${build.dir}/testclasses"/>
+ <property name="testreports.dir"
location="${build.dir}/test-reports"/>
+ <property name="dist.target.dir" location="target"/>
+ <property name="dist.dir"
location="${dist.target.dir}/${name}"/>
+ <property name="instrumenttest.out.dir"
value="${build.dir}/test-reports/instrument"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="doc.api.dir" location="${doc.dir}/api"/>
+ <property name="doc.reference.dir"
location="${doc.dir}/reference"/>
+
+ <property name="dist.doc.dir" location="${dist.dir}/doc"/>
+ <property name="dist.api.dir"
location="${dist.dir}/doc/api"/>
+
+ <property name="dist.src.dir" location="${dist.dir}/src"/>
+ <property name="dist.test.dir" location="${dist.dir}/test"/>
+ <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+ <property name="jar.name" value="${name}"/>
+ <property name="jar.file.name"
value="${dist.dir}/${jar.name}.jar"/>
+ <property name="jartest.file.name"
value="${dist.dir}/${jar.name}-tests.jar"/>
+
+ <property name="javadoc"
value="http://java.sun.com/j2se/1.4/docs/api"/>
+ <property name="javac.debug" value="on"/>
+ <property name="javac.optimize" value="off"/>
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+
+ <property name="pom.file" value="pom.xml"/>
+ <property name="src.jar" value="${build.dir}/src.jar"/>
+
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
- <fileset dir="${common-build.basedir}/lib/build"><!--
${build.lib.dir} fails in reference doc build -->
+ <fileset dir="${common-build.basedir}/lib/build">
+ <!-- ${build.lib.dir} fails in reference doc build -->
<include name="junit-*.jar"/>
<include name="ant-junit-*.jar"/>
</fileset>
</classpath>
- </taskdef>
-
- <taskdef name="junitreport"
classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+ </taskdef>
+
+ <taskdef name="junitreport"
+ classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
<classpath>
- <fileset dir="${common-build.basedir}/lib/build"><!--
${build.lib.dir} fails in reference doc build -->
+ <fileset dir="${common-build.basedir}/lib/build">
+ <!-- ${build.lib.dir} fails in reference doc build -->
<include name="junit-*.jar"/>
<include name="ant-junit-*.jar"/>
</fileset>
- </classpath>
- </taskdef>
-
- <!-- ivy load -->
- <property name="ivy.jar.dir" value="${common-build.basedir}/ivy"
/>
- <property name="ivy.conf.dir" value="${common-build.basedir}"
/>
- <path id="ivy.lib.path">
- <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
- </path>
- <taskdef resource="fr/jayasoft/ivy/ant/antlib.xml"
- uri="antlib:fr.jayasoft.ivy.ant"
classpathref="ivy.lib.path"/>
-
- <!-- maven task load -->
- <path id="maven-ant-tasks.path"
path="${ivy.jar.dir}/maven-ant-tasks.jar" />
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
- uri="urn:maven-artifact-ant"
- classpathref="maven-ant-tasks.path" />
-
- <artifact:remoteRepository id="offline.repository.jboss.org"
url="file://${offline.repository.jboss.org}" />
-
- <path id="lib.class.path">
- <path refid="lib.moduleclass.path"/>
- <pathelement path="${clover.jar}"/>
- </path>
-
- <!-- overridable in modules -->
- <path id="lib.moduleclass.path"/>
-
- <patternset id="support.files">
- <include name="**/*.jpg"/>
- <include name="**/*.gif"/>
- <include name="**/*.dtd"/>
- <include name="**/*.xsd"/>
- <include name="**/*.xml"/>
- <include name="**/*.xslt"/>
-
- <!-- exclude everything we don't want in the jar -->
- <exclude name="${build.dir}/**/*"/>
- <exclude name="${doc.dir}/**/*"/>
- <exclude name="classes/**/*"/>
- <exclude name="build.xml"/>
- <exclude name="**/*.properties"/>
- <exclude name="**/*.ccf"/>
- <exclude name="**/*.cfg.xml"/>
- <exclude name="**/ehcache.xml"/>
- </patternset>
-
- <patternset id="source.files">
- <include name="**/*.java"/>
- <include name="**/*.properties"/>
- </patternset>
-
- <!-- junit paths/filesets -->
- <fileset dir="${testclasses.dir}"
id="junit.batchtestset">
- <include name="**/*Test.class"/>
- </fileset>
-
- <path id="testsrc.path">
- <pathelement location="${test.dir}"/>
- </path>
-
- <!-- Clover -->
- <property name="clover.out.dir" value="cloverout"/>
- <property name="clover.jar"
value="${ant.home}/lib/clover.jar"/>
- <taskdef resource="clovertasks"/>
-
- <path id="junit.classpath">
- <pathelement path="${classes.dir}"/>
- <pathelement path="${testclasses.dir}"/>
- <path refid="lib.class.path"/>
- <path refid="junit.moduleclasspath"/>
- <path location="${clover.jar}"/>
- </path>
-
- <!-- Clover tasks -->
- <target name="with.clover">
- <clover-setup initString="clover_coverage.db"/>
- </target>
-
- <target name="cloverreport.html" depends="with.clover"
- description="Generate a clover report from the current clover
database.">
- <clover-report>
- <current outfile="${clover.out.dir}">
- <format type="html"/>
- </current>
- </clover-report>
- </target>
-
- <target name="cloverreport"
depends="with.clover,junitreport,cloverreport.html"
- description="Run the tests and generate a clover report">
- </target>
-
- <!-- Tasks -->
-
- <target name="clean" description="Cleans up build and dist
directories">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.target.dir}"/>
- <delete dir="${clover.out.dir}"/>
- </target>
-
- <target name="init" description="Initialize the build">
- <tstamp>
- <format property="subversion" pattern="yyyy-MM-dd
hh:mm:ss"/>
- </tstamp>
- <echo message="Build ${Name}-${version} (${subversion})"/>
- <mkdir dir="${classes.dir}"/>
- <mkdir dir="${testclasses.dir}"/>
- <copy todir="${classes.dir}">
- <fileset dir="${src.dir}">
- <patternset refid="support.files"/>
- </fileset>
- </copy>
-
- <copy todir="${build.dir}">
- <fileset dir=".">
- <include name="readme.txt"/>
- <include name="lgpl.txt"/>
- </fileset>
- </copy>
- </target>
-
- <target name="compile" depends="init"
description="Compile the Java source code">
- <available
- classname="org.eclipse.core.launcher.Main"
- property="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"
- classpath="${java.class.path}"/>
- <javac
- target="${javac.target}"
- source="${javac.source}"
- srcdir="${src.dir}"
- destdir="${classes.dir}"
- classpathref="lib.class.path"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- nowarn="on">
- </javac>
- </target>
-
- <target name="compiletest" depends="compile"
description="Compile the tests">
- <available
- classname="org.eclipse.core.launcher.Main"
- property="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"
- classpath="${java.class.path}"/>
- <javac
- target="${javac.target}"
- source="${javac.source}"
- destdir="${testclasses.dir}"
- classpathref="junit.classpath"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- nowarn="on">
- <src refid="testsrc.path"/>
- </javac>
+ </classpath>
+ </taskdef>
+
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <fileset dir="${common-build.basedir}/lib/build">
+ <!-- ${build.lib.dir} fails in reference doc build -->
+ <include name="ant-contrib-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <!-- ivy load -->
+ <property name="ivy.jar.dir"
value="${common-build.basedir}/ivy"/>
+ <property name="ivy.conf.dir"
value="${common-build.basedir}"/>
+ <path id="ivy.lib.path">
+ <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+ </path>
+ <taskdef resource="fr/jayasoft/ivy/ant/antlib.xml"
+ uri="antlib:fr.jayasoft.ivy.ant" classpathref="ivy.lib.path"/>
+
+ <!-- maven task load -->
+ <path id="maven-ant-tasks.path"
path="${ivy.jar.dir}/maven-ant-tasks.jar"/>
+ <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+ uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.path"/>
+
+ <artifact:remoteRepository id="offline.repository.jboss.org"
+ url="file://${offline.repository.jboss.org}"/>
+
+ <path id="lib.class.path">
+ <path refid="lib.moduleclass.path"/>
+ <pathelement path="${clover.jar}"/>
+ </path>
+
+ <!-- overridable in modules -->
+ <path id="lib.moduleclass.path"/>
+
+ <patternset id="support.files">
+ <include name="**/*.jpg"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.dtd"/>
+ <include name="**/*.xsd"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xslt"/>
+
+ <!-- exclude everything we don't want in the jar -->
+ <exclude name="${build.dir}/**/*"/>
+ <exclude name="${doc.dir}/**/*"/>
+ <exclude name="classes/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="**/*.properties"/>
+ <exclude name="**/*.ccf"/>
+ <exclude name="**/*.cfg.xml"/>
+ <exclude name="**/ehcache.xml"/>
+ </patternset>
+
+ <patternset id="source.files">
+ <include name="**/*.java"/>
+ <include name="**/*.properties"/>
+ </patternset>
+
+ <!-- junit paths/filesets -->
+ <fileset dir="${testclasses.dir}" id="junit.batchtestset">
+ <include name="**/*Test.class"/>
+ </fileset>
+
+ <path id="testsrc.path">
+ <pathelement location="${test.dir}"/>
+ </path>
+
+ <path id="junit.classpath">
+ <pathelement path="${classes.dir}"/>
+ <pathelement path="${testclasses.dir}"/>
+ <path refid="lib.class.path"/>
+ <path refid="junit.moduleclasspath"/>
+ <path location="${clover.jar}"/>
+ </path>
+
+ <!-- Determine the database against which to run tests-->
+ <if>
+ <equals arg1="${targetdb}" arg2="$${targetdb}"/>
+ <then>
+ <echo message="No target database specified using default HSQLDB"/>
+ <property name="targetdb" value="hsqldb"/>
+ </then>
+ </if>
+
+ <!-- Clover tasks -->
+ <target name="with.clover">
+ <clover-setup initString="clover_coverage.db"/>
+ </target>
+
+ <target name="cloverreport.html" depends="with.clover"
+ description="Generate a clover report from the current clover database.">
+ <clover-report>
+ <current outfile="${clover.out.dir}">
+ <format type="html"/>
+ </current>
+ </clover-report>
+ </target>
+
+ <target name="cloverreport"
+ depends="with.clover,junitreport,cloverreport.html"
+ description="Run the tests and generate a clover report">
+ </target>
+
+ <!-- Tasks -->
+ <target name="clean" description="Cleans up build and dist
directories">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.target.dir}"/>
+ <delete dir="${clover.out.dir}"/>
+ </target>
+
+ <target name="init" description="Initialize the build">
+ <tstamp>
+ <format property="subversion" pattern="yyyy-MM-dd
hh:mm:ss"/>
+ </tstamp>
+ <echo message="Build ${Name}-${version} (${subversion})"/>
+ <mkdir dir="${classes.dir}"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${build.dir}">
+ <fileset dir=".">
+ <include name="readme.txt"/>
+ <include name="lgpl.txt"/>
+ </fileset>
+ </copy>
</target>
-
- <target name="instrument" depends="compiletest"
- description="Instrument the persistent classes"> <!--
depends="jar" -->
-
- <taskdef name="instrument"
classname="org.hibernate.tool.instrument.InstrumentTask">
- <classpath path="${classes.dir}"/>
- <classpath path="${testclasses.dir}"/>
- <classpath refid="lib.class.path"/>
- </taskdef>
-
- <instrument verbose="true">
- <fileset dir="${testclasses.dir}/org/hibernate/test">
- <include name="**/*.class"/>
- <exclude name="**/*Test$*.class"/>
- <exclude name="**/*Test.class"/>
- <exclude name="**/*Tests.class"/>
- </fileset>
- </instrument>
-
- <!-- jar jarfile="${build.dir}/instrumented-classes.jar">
- <fileset dir="${testclasses.dir}">
- <include name="org/hibernate/test/**/*.class"/>
- <exclude name="org/hibernate/test/**/*Test.class"/>
- </fileset>
- </jar -->
-
- </target>
-
- <target name="copytest" description="Copy tests to dist dir"
if="copy.test" >
- <mkdir dir="${dist.test.dir}"/>
- <copy todir="${dist.test.dir}">
- <fileset dir="${test.dir}"/>
- </copy>
- </target>
-
- <target name="copysource" depends="copytest"
description="Copy sources to dist dir">
- <mkdir dir="${dist.src.dir}"/>
- <copy todir="${dist.src.dir}">
- <fileset dir="${src.dir}">
- <patternset refid="source.files"/>
- </fileset>
- <fileset dir="${src.dir}">
- <patternset refid="support.files"/>
- </fileset>
- </copy>
- <mkdir dir="${dist.src.dir}"/>
- <copy todir="${dist.src.dir}">
- <fileset dir="${src.dir}">
- <patternset refid="source.files"/>
- </fileset>
- <fileset dir="${src.dir}">
- <patternset refid="support.files"/>
- </fileset>
- </copy>
- </target>
+ <target name="get.deps.core" depends="init"
+ description="retrieve the core dependencies">
+ <ivy:resolve conf="default"/>
+ <ivy:retrieve pattern="${ivy.dep.dir}/core/[artifact].[ext]"
+ conf="default"/>
+ </target>
+
+ <target name="get.deps.test" depends="init"
+ description="retrieve the test dependencies">
+ <ivy:resolve conf="test"/>
+ <ivy:retrieve pattern="${ivy.dep.dir}/test/[artifact].[ext]"
conf="test"/>
+ </target>
+
+ <target name="copytest" description="Copy tests to dist dir"
if="copy.test">
+ <mkdir dir="${dist.test.dir}"/>
+ <copy todir="${dist.test.dir}">
+ <fileset dir="${test.dir}"/>
+ </copy>
+ </target>
+
+ <target name="copysource" depends="copytest"
+ description="Copy sources to dist dir">
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.src.dir}"/>
+ <copy todir="${dist.src.dir}">
+ <fileset dir="${src.dir}">
+ <patternset refid="source.files"/>
+ </fileset>
+ <fileset dir="${src.dir}">
+ <patternset refid="support.files"/>
+ </fileset>
+ </copy>
+ </target>
+
<target name="copylib" description="Copy jars to lib dir">
<mkdir dir="${dist.lib.dir}"/>
<copy todir="${dist.lib.dir}" verbose="true">
@@ -283,194 +254,197 @@
</fileset>
</copy>
</target>
+
+ <target name="copydoc" description="Copy doc to dist dir"
if="copy.doc">
+ <mkdir dir="${dist.doc.dir}"/>
+ <copy todir="${dist.doc.dir}">
+ <fileset dir="${doc.dir}">
+ <include name="**/*.html"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="jar" depends="compile"
+ description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jar.file.name}"
+ basedir="${classes.dir}"/>
+ </target>
+
+ <target name="jartest" depends="compiletest"
+ description="Build the distribution .jar file">
+ <mkdir dir="${dist.dir}"/>
+ <jar filesetmanifest="merge" jarfile="${jartest.file.name}"
+ basedir="${testclasses.dir}"/>
+ </target>
+
+ <!-- DOCUMENTATION -->
+
+ <target name="javadoc"
+ description="Compile the Javadoc API documentation to dist dir">
+ <mkdir dir="${dist.api.dir}"/>
+ <javadoc packagenames="${javadoc.packagenames}"
+ classpathref="lib.class.path" destdir="${dist.api.dir}"
use="true"
+ protected="true" version="true"
+ windowtitle="${Name} API Documentation"
+ Overview="${doc.api.dir}/package.html"
+ doctitle="${Name} API Documentation"
+ stylesheetfile="${doc.api.dir}/jdstyle.css" link="${javadoc}">
+ <packageset dir="${src.dir}" defaultexcludes="yes">
+ <include name="**/*"/>
+ </packageset>
+ </javadoc>
+ </target>
+
+ <target name="extras" description="Copies miscellaneous files to root
dir">
+ <copy todir="${dist.dir}/bin" failonerror="false">
+ <fileset dir="bin">
+ <include name="*.bat"/>
+ </fileset>
+ </copy>
+ <copy file="readme.txt" todir="${dist.dir}"/>
+ <copy file="lgpl.txt" todir="${dist.dir}"/>
+ <copy file="changelog.txt" todir="${dist.dir}"/>
+ <copy file="build.xml" todir="${dist.dir}"/>
+ <replace file="${dist.dir}/build.xml">
+ <replacetoken><![CDATA[../${name}-${version}]]>
+ </replacetoken>
+ <replacevalue><![CDATA[../${name}]]>
+ </replacevalue>
+ </replace>
+ </target>
+
+ <target name="dist"
depends="jar,javadoc,copysource,copydoc,extras"
+ description="Build everything">
+ <zip zipfile="${dist.dir}-${version}.zip">
+ <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </zip>
+ <tar compression="gzip"
tarfile="${dist.dir}-${version}.tar.gz">
+ <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+ </tar>
+ </target>
+
+ <target name="info" description="Echoes useful system
properties">
+ <echo message="java.vm.info=${java.vm.info}"/>
+ <echo message="java.vm.name=${java.vm.name}"/>
+ <echo message="java.vm.vendor=${java.vm.vendor}"/>
+ <echo message="java.vm.version=${java.vm.version}"/>
+ <echo message="os.arch=${os.arch}"/>
+ <echo message="os.name=${os.name}"/>
+ <echo message="os.version=${os.version}"/>
+ <echo message="java.home = ${java.home}"/>
+ <echo message="java.class.path = ${java.class.path}"/>
+ <echo message="build.compiler = ${build.compiler}"/>
+ <echo message="file.encoding=${file.encoding}"/>
+ <echo message="user.home = ${user.home}"/>
+ <echo message="user.language=${user.language}"/>
+ </target>
+
+ <target name="test-resources" description="Copies and filters test
resources">
+ <filter filtersfile="${filter.dir}/${db}.filter"/>
+ <mkdir dir="${testclasses.dir}"/>
+ <copy todir="${testclasses.dir}" filtering="true"
overwrite="true">
+ <fileset dir="${test.resources.dir}">
+ <include name="*.properties"/>
+ <include name="*.xml"/>
+ </fileset>
+ </copy>
+ </target>
- <target name="copydoc" description="Copy doc to dist dir"
if="copy.doc">
- <mkdir dir="${dist.doc.dir}"/>
- <copy todir="${dist.doc.dir}">
- <fileset dir="${doc.dir}">
- <include name="**/*.html"/>
- </fileset>
- </copy>
- </target>
-
- <target name="jar" depends="compile" description="Build
the distribution .jar file">
- <mkdir dir="${dist.dir}"/>
- <jar filesetmanifest="merge" jarfile="${jar.file.name}"
basedir="${classes.dir}"/>
- </target>
-
- <target name="jartest" depends="compiletest"
description="Build the distribution .jar file">
- <mkdir dir="${dist.dir}"/>
- <jar filesetmanifest="merge"
jarfile="${jartest.file.name}" basedir="${testclasses.dir}"/>
- </target>
-
- <!-- DOCUMENTATION -->
-
- <target name="javadoc" description="Compile the Javadoc API
documentation to dist dir">
- <mkdir dir="${dist.api.dir}"/>
- <javadoc
- packagenames="${javadoc.packagenames}"
- classpathref="lib.class.path"
- destdir="${dist.api.dir}"
- use="true"
- protected="true"
- version="true"
- windowtitle="${Name} API Documentation"
- Overview="${doc.api.dir}/package.html"
- doctitle="${Name} API Documentation"
- stylesheetfile="${doc.api.dir}/jdstyle.css"
- link="${javadoc}">
- <packageset dir="${src.dir}" defaultexcludes="yes" >
- <include name="**/*" />
- </packageset>
- </javadoc>
-
-
- </target>
-
-
- <target name="extras" description="Copies miscellaneous files to root
dir">
- <copy todir="${dist.dir}/bin" failonerror="false">
- <fileset dir="bin">
- <include name="*.bat"/>
- </fileset>
- </copy>
- <copy file="readme.txt" todir="${dist.dir}"/>
- <copy file="lgpl.txt" todir="${dist.dir}"/>
- <copy file="changelog.txt" todir="${dist.dir}"/>
- <copy file="build.xml" todir="${dist.dir}"/>
- <replace file="${dist.dir}/build.xml">
- <replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
- <replacevalue><![CDATA[../${name}]]></replacevalue>
- </replace>
- </target>
-
- <target name="dist"
depends="jar,javadoc,copysource,copydoc,extras" description="Build
everything">
- <zip zipfile = "${dist.dir}-${version}.zip">
- <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
- </zip>
- <tar compression="gzip"
tarfile="${dist.dir}-${version}.tar.gz">
- <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
- </tar>
- </target>
-
- <target name="info" description="Echoes useful system
properties">
- <echo message="java.vm.info=${java.vm.info}"/>
- <echo message="java.vm.name=${java.vm.name}"/>
- <echo message="java.vm.vendor=${java.vm.vendor}"/>
- <echo message="java.vm.version=${java.vm.version}"/>
- <echo message="os.arch=${os.arch}"/>
- <echo message="os.name=${os.name}"/>
- <echo message="os.version=${os.version}"/>
- <echo message="java.home = ${java.home}"/>
- <echo message="java.class.path = ${java.class.path}"/>
- <echo message="build.compiler = ${build.compiler}"/>
- <echo message="file.encoding=${file.encoding}"/>
- <echo message="user.home = ${user.home}"/>
- <echo message="user.language=${user.language}"/>
- </target>
-
- <target name="junit" depends="compiletest">
- <mkdir dir="${testreports.dir}"/>
- <junit printsummary="yes" haltonfailure="yes"
forkmode="once">
- <classpath refid="junit.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml"/>
- <batchtest fork="yes" todir="${testreports.dir}"
haltonfailure="no">
- <fileset refid="junit.batchtestset"/>
- </batchtest>
- </junit>
- </target>
-
- <!-- Run a single unit test. -->
- <target name="junitsingle" depends="compiletest"
description="Run a single test suite (requires testname and jdbc.driver
properties)">
- <mkdir dir="${testreports.dir}"/>
- <junit printsummary="yes" fork="yes"
haltonfailure="yes">
+ <target name="instrument" depends="compiletest"
+ description="Instrument the persistent classes"> <!--
depends="jar" -->
+
+ <taskdef name="instrument"
+ classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
<classpath refid="junit.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml"/>
- <test fork="yes" todir="${testreports.dir}"
haltonfailure="no" name="${testname}"/>
- </junit>
- </target>
-
- <target name="junitinstrument" depends="compiletest,instrument"
- description="Run the instrument test suite (requires driver.jar
property)">
- <mkdir dir="${instrumenttest.out.dir}"/>
- <junit printsummary="yes" haltonfailure="yes"
dir="${basedir}"
- maxmemory="256M" fork="yes" forkmode="perBatch">
- <classpath refid="junit.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml"/>
- <batchtest todir="${instrumenttest.out.dir}"
haltonfailure="no">
- <fileset dir="${classes.dir}">
- <include name="org/hibernate/test/**/*Test.class"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="junitreport" depends="">
- <junitreport todir="${testreports.dir}">
- <fileset dir="${testreports.dir}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames"
todir="${testreports.dir}"/>
- </junitreport>
- </target>
-
- <target name="run" depends="compile" description="Run
Hibernate Console">
- <java classname="org.hibernate.console.Start"
classpathref="lib.class.path" fork="true">
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- </java>
- </target>
-
-
- <target name="checkstyle" description="Check coding
style">
- <taskdef resource="checkstyletask.properties">
- <classpath>
- <path refid="lib.class.path"/>
- <fileset dir="${common-build.basedir}/lib">
- <include name="checkstyle*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
-
- <checkstyle
config="${common-build.basedir}/checkstyle_checks.xml">
- <fileset dir="${src.dir}">
- <include name="**/*.java"/>
+ </taskdef>
+
+ <instrument verbose="true">
+ <fileset dir="${testclasses.dir}/org/hibernate/test">
+ <include name="**/*.class"/>
+ <exclude name="**/*Test$*.class"/>
+ <exclude name="**/*Test.class"/>
+ <exclude name="**/*Tests.class"/>
</fileset>
- <formatter type="plain"/>
- </checkstyle>
- </target>
-
- <target name="patch" depends="checkstyle"
- description="Create a patch">
- <cvs command="-q diff -u -N" output="patch.txt"/>
- </target>
-
- <!-- maven deploy: to be used by the subbuild and delcare deps on jar -->
- <target name="deploy" depends="jar">
- <fail unless="offline.repository.jboss.org"
message="offline.repository.jboss.org must be defined"/>
- <jar jarfile="${src.jar}" basedir="${src.dir}">
- <include name="**/*.java" />
- <exclude name="**/test/*.java" />
- <!-- patternset refid="meta.files" / -->
- </jar>
-
- <artifact:pom id="maven.project" file="${pom.file}" />
-
- <artifact:install file="${jar.file.name}">
- <pom refid="maven.project"/>
- </artifact:install>
-
- <artifact:deploy file="${jar.file.name}">
- <pom refid="maven.project" />
- <remoteRepository refId="offline.repository.jboss.org">
- </remoteRepository>
- <attach file="${src.jar}" classifier="sources" />
- <attach file="${jar.file.name}" classifier="" />
- </artifact:deploy>
- </target>
-
+ </instrument>
+ </target>
+
+ <target name="junitinstrument" depends="compiletest,instrument"
+ description="Run the instrument test suite">
+ <for list="${targetdb}" param="db">
+ <sequential>
+ <antcall target="test-resources">
+ <param name="db" value="@{db}"/>
+ </antcall>
+ <mkdir dir="${instrumenttest.out.dir}/@{db}"/>
+ <echo>Running against db: @{db}</echo>
+ <junit printsummary="yes" haltonfailure="yes"
dir="${basedir}"
+ maxmemory="256M" fork="yes" forkmode="perBatch">
+ <classpath refid="junit.classpath"/>
+ <formatter type="plain"/>
+ <formatter type="xml"/>
+ <batchtest todir="${instrumenttest.out.dir}/@{db}"
haltonfailure="no">
+ <fileset refid="junit.batchtestset"/>
+ </batchtest>
+ </junit>
+ </sequential>
+ </for>
+ </target>
+
+ <target name="junitreport" depends="">
+ <junitreport todir="${testreports.dir}">
+ <fileset dir="${testreports.dir}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${testreports.dir}"/>
+ </junitreport>
+ </target>
+
+ <target name="checkstyle" description="Check coding style">
+ <taskdef resource="checkstyletask.properties">
+ <classpath>
+ <path refid="lib.class.path"/>
+ <fileset dir="${common-build.basedir}/lib">
+ <include name="checkstyle*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+
+ <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
+ <fileset dir="${src.dir}">
+ <include name="**/*.java"/>
+ </fileset>
+ <formatter type="plain"/>
+ </checkstyle>
+ </target>
+
+ <target name="patch" depends="checkstyle"
description="Create a patch">
+ <cvs command="-q diff -u -N" output="patch.txt"/>
+ </target>
+
+ <!-- maven deploy: to be used by the subbuild and delcare deps on jar -->
+ <target name="deploy" depends="jar">
+ <fail unless="offline.repository.jboss.org"
+
message="offline.repository.jboss.org must be defined"/>
+ <jar jarfile="${src.jar}" basedir="${src.dir}">
+ <include name="**/*.java"/>
+ <exclude name="**/test/*.java"/>
+ <!-- patternset refid="meta.files" / -->
+ </jar>
+
+ <artifact:pom id="maven.project" file="${pom.file}"/>
+
+ <artifact:install file="${jar.file.name}">
+ <pom refid="maven.project"/>
+ </artifact:install>
+
+ <artifact:deploy file="${jar.file.name}">
+ <pom refid="maven.project"/>
+ <remoteRepository refId="offline.repository.jboss.org">
+ </remoteRepository>
+ <attach file="${src.jar}" classifier="sources"/>
+ <attach file="${jar.file.name}" classifier=""/>
+ </artifact:deploy>
+ </target>
+
</project>
\ No newline at end of file
Modified: annotations/trunk/doc/reference/build.xml
===================================================================
--- annotations/trunk/doc/reference/build.xml 2008-08-11 08:59:29 UTC (rev 15024)
+++ annotations/trunk/doc/reference/build.xml 2008-08-11 09:14:39 UTC (rev 15025)
@@ -1,10 +1,7 @@
<project name="Documentation" default="all.doc"
basedir=".">
- <!-- Use the core Hibernate3 doc build system -->
- <import file="../../common-build.xml"/>
<import file="docbook-common-build.xml"/>
-
<target name="all.doc" depends="clean">
<!-- TRANSLATOR: Duplicate this call for your language -->
Added: annotations/trunk/lib/build/ant-contrib-1.0b2.jar
===================================================================
(Binary files differ)
Property changes on: annotations/trunk/lib/build/ant-contrib-1.0b2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: annotations/trunk/src/filters/db2.filter
===================================================================
--- annotations/trunk/src/filters/db2.filter (rev 0)
+++ annotations/trunk/src/filters/db2.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,9 @@
+## DB2
+
+hibernate.dialect org.hibernate.dialect.DB2Dialect
+hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
+hibernate.connection.url jdbc:db2:hibernate
+
+
Property changes on: annotations/trunk/src/filters/db2.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/derby.filter
===================================================================
--- annotations/trunk/src/filters/derby.filter (rev 0)
+++ annotations/trunk/src/filters/derby.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,9 @@
+## Derby
+
+hibernate.dialect org.hibernate.dialect.DerbyDialect
+hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
+hibernate.connection.username
+hibernate.connection.password
+hibernate.connection.url jdbc:derby:/hibernate;create=true
+
+
Property changes on: annotations/trunk/src/filters/derby.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/hsqldb.filter
===================================================================
--- annotations/trunk/src/filters/hsqldb.filter (rev 0)
+++ annotations/trunk/src/filters/hsqldb.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,8 @@
+## HSQLDB
+
+hibernate.dialect org.hibernate.dialect.HSQLDialect
+hibernate.connection.driver_class org.hsqldb.jdbcDriver
+hibernate.connection.username sa
+hibernate.connection.password
+hibernate.connection.url jdbc\:hsqldb\:.
+
Property changes on: annotations/trunk/src/filters/hsqldb.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/mckoi.filter
===================================================================
--- annotations/trunk/src/filters/mckoi.filter (rev 0)
+++ annotations/trunk/src/filters/mckoi.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,9 @@
+## Mckoi
+
+hibernate.dialect org.hibernate.dialect.MckoiDialect
+hibernate.connection.driver_class com.mckoi.JDBCDriver
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
+hibernate.connection.url jdbc:mckoi://localhost/hibernate
+
+
Property changes on: annotations/trunk/src/filters/mckoi.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/mssql.filter
===================================================================
--- annotations/trunk/src/filters/mssql.filter (rev 0)
+++ annotations/trunk/src/filters/mssql.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,9 @@
+## MS SQL Server
+
+hibernate.dialect org.hibernate.dialect.SQLServerDialect
+hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
+hibernate.connection.url jdbc:jtds:sqlserver://localhost/hibernate
+
+
Property changes on: annotations/trunk/src/filters/mssql.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/mysql.filter
===================================================================
--- annotations/trunk/src/filters/mysql.filter (rev 0)
+++ annotations/trunk/src/filters/mysql.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,7 @@
+## MySQL
+
+hibernate.dialect org.hibernate.dialect.MySQLDialect
+hibernate.connection.driver_class com.mysql.jdbc.Driver
+hibernate.connection.url jdbc:mysql://localhost/hibernate
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
Property changes on: annotations/trunk/src/filters/mysql.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/oracle.filter
===================================================================
--- annotations/trunk/src/filters/oracle.filter (rev 0)
+++ annotations/trunk/src/filters/oracle.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,9 @@
+## Oracle
+
+hibernate.dialect org.hibernate.dialect.OracleDialect
+#hibernate.dialect org.hibernate.dialect.Oracle9Dialect
+hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
+hibernate.connection.url jdbc:oracle:thin:@localhost:1521:hibernate
+
Property changes on: annotations/trunk/src/filters/oracle.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/postgresql.filter
===================================================================
--- annotations/trunk/src/filters/postgresql.filter (rev 0)
+++ annotations/trunk/src/filters/postgresql.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,8 @@
+## PostgreSQL
+
+hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
+hibernate.connection.driver_class org.postgresql.Driver
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
+hibernate.connection.url jdbc:postgresql:hibernate
+
Property changes on: annotations/trunk/src/filters/postgresql.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: annotations/trunk/src/filters/sybase.filter
===================================================================
--- annotations/trunk/src/filters/sybase.filter (rev 0)
+++ annotations/trunk/src/filters/sybase.filter 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,9 @@
+## Sybase
+
+hibernate.dialect org.hibernate.dialect.SybaseDialect
+hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
+hibernate.connection.username hibernate
+hibernate.connection.password hibernate
+hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/hibernate
+
+
Property changes on: annotations/trunk/src/filters/sybase.filter
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Deleted: annotations/trunk/src/test/ehcache.xml
===================================================================
--- annotations/trunk/src/test/ehcache.xml 2008-08-11 08:59:29 UTC (rev 15024)
+++ annotations/trunk/src/test/ehcache.xml 2008-08-11 09:14:39 UTC (rev 15025)
@@ -1,80 +0,0 @@
-<ehcache>
- <!-- Sets the path to the directory where cache .data files are created.
- If the path is a Java System Property it is replaced by
- its value in the running VM.
-
- The following properties are translated:
- user.home - User's home directory
- user.dir - User's current working directory
- java.io.tmpdir - Default temp file path -->
-
- <diskStore path="java.io.tmpdir"/>
- <!--Default Cache configuration. These will applied to caches programmatically
created through
- the CacheManager.
- The following attributes are required for defaultCache:
- maxInMemory - Sets the maximum number of objects that will be created in
memory
- eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
- is never expired.
- timeToIdleSeconds - Sets the time to idle for an element before it expires. Is
only used
- if the element is not eternal. Idle time is now - last
accessed time
- timeToLiveSeconds - Sets the time to live for an element before it expires. Is
only used
- if the element is not eternal. TTL is now - creation time
- overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
- has reached the maxInMemory limit.
-
- -->
-
- <defaultCache
- maxElementsInMemory="10000"
- eternal="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- overflowToDisk="true"
- />
- <!--Predefined caches. Add your cache configuration settings here.
- If you do not have a configuration for your cache a WARNING will be issued when
the
- CacheManager starts
- The following attributes are required for defaultCache:
- name - Sets the name of the cache. This is used to identify the
cache. It must be unique.
- maxInMemory - Sets the maximum number of objects that will be created in
memory
- eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
- is never expired.
- timeToIdleSeconds - Sets the time to idle for an element before it expires. Is
only used
- if the element is not eternal. Idle time is now - last
accessed time
- timeToLiveSeconds - Sets the time to live for an element before it expires. Is
only used
- if the element is not eternal. TTL is now - creation time
- overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
- has reached the maxInMemory limit.
- -->
-
- <!-- Sample cache named sampleCache1
- This cache contains a maximum in memory of 10000 elements, and will expire
- an element if it is idle for more than 5 minutes and lives for more than
- 10 minutes.
-
- If there are more than 10000 elements it will overflow to the
- disk cache, which in this configuration will go to wherever java.io.tmp is
- defined on your system. On a standard Linux system this will be /tmp"
- -->
-
- <cache name="sampleCache1"
- maxElementsInMemory="10000"
- eternal="false"
- timeToIdleSeconds="300"
- timeToLiveSeconds="600"
- overflowToDisk="true"
- />
-
- <!-- Sample cache named sampleCache2
- This cache contains 1000 elements. Elements will always be held in memory.
- They are not expired. -->
- <cache name="sampleCache2"
- maxElementsInMemory="1000"
- eternal="true"
- timeToIdleSeconds="0"
- timeToLiveSeconds="0"
- overflowToDisk="false"
- />
-
- <!-- Place configuration for your caches following -->
-</ehcache>
\ No newline at end of file
Deleted: annotations/trunk/src/test/hibernate.properties
===================================================================
--- annotations/trunk/src/test/hibernate.properties 2008-08-11 08:59:29 UTC (rev 15024)
+++ annotations/trunk/src/test/hibernate.properties 2008-08-11 09:14:39 UTC (rev 15025)
@@ -1,470 +0,0 @@
-######################
-### Query Language ###
-######################
-
-## define query language constants / function names
-
-hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
-
-
-## select the classic query parser
-
-#hibernate.query.factory_class org.hibernate.hql.classic.ClassicQueryTranslatorFactory
-
-hibernate.format_sql true
-
-
-
-#################
-### Platforms ###
-#################
-
-## JNDI Datasource
-
-#hibernate.connection.datasource jdbc/test
-#hibernate.connection.username db2
-#hibernate.connection.password db2
-
-
-## HypersonicSQL
-
-hibernate.dialect org.hibernate.dialect.HSQLDialect
-hibernate.connection.driver_class org.hsqldb.jdbcDriver
-hibernate.connection.username sa
-hibernate.connection.password
-hibernate.connection.url jdbc\:hsqldb\:.
-
-
-## MySQL
-
-#hibernate.dialect org.hibernate.dialect.MySQLDialect
-#hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
-#hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
-#hibernate.connection.driver_class com.mysql.jdbc.Driver
-#hibernate.connection.url jdbc:mysql://localhost/hibernate
-#hibernate.connection.username hibernate
-#hibernate.connection.password hibernate
-
-
-## Oracle
-
-#hibernate.dialect org.hibernate.dialect.OracleDialect
-#hibernate.dialect org.hibernate.dialect.Oracle9Dialect
-#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
-#hibernate.connection.username ora
-#hibernate.connection.password ora
-#hibernate.connection.url jdbc:oracle:thin:@localhost:1521:test
-
-
-## PostgreSQL
-
-#hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
-#hibernate.connection.driver_class org.postgresql.Driver
-#hibernate.connection.url jdbc:postgresql:annotations
-#hibernate.connection.username postgres
-#hibernate.connection.password hibernate
-#hibernate.query.substitutions yes 'Y', no 'N'
-
-
-## DB2
-
-#hibernate.dialect org.hibernate.dialect.DB2Dialect
-#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
-#hibernate.connection.url jdbc:db2:test
-#hibernate.connection.username db2
-#hibernate.connection.password db2
-
-## TimesTen (not supported yet)
-
-#hibernate.dialect org.hibernate.dialect.TimesTenDialect
-#hibernate.connection.driver_class com.timesten.jdbc.TimesTenDriver
-#hibernate.connection.url jdbc:timesten:direct:test
-#hibernate.connection.username
-#hibernate.connection.password
-
-## DB2/400
-
-#hibernate.dialect org.hibernate.dialect.DB2400Dialect
-#hibernate.connection.username user
-#hibernate.connection.password password
-
-## Native driver
-#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
-#hibernate.connection.url jdbc:db2://systemname
-
-## Toolbox driver
-#hibernate.connection.driver_class com.ibm.as400.access.AS400JDBCDriver
-#hibernate.connection.url jdbc:as400://systemname
-
-
-## Derby (Not supported!)
-
-#hibernate.dialect org.hibernate.dialect.DerbyDialect
-#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
-#hibernate.connection.username
-#hibernate.connection.password
-#hibernate.connection.url jdbc:derby:/test;create=true
-
-
-## Sybase
-
-#hibernate.dialect org.hibernate.dialect.SybaseDialect
-#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
-#hibernate.connection.username sa
-#hibernate.connection.password sasasa
-#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
-
-
-## Mckoi SQL
-
-#hibernate.dialect org.hibernate.dialect.MckoiDialect
-#hibernate.connection.driver_class com.mckoi.JDBCDriver
-#hibernate.connection.url jdbc:mckoi:///
-#hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.00/db.conf
-#hibernate.connection.username admin
-#hibernate.connection.password nimda
-
-
-## SAP DB
-
-#hibernate.dialect org.hibernate.dialect.SAPDBDialect
-#hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
-#hibernate.connection.url jdbc:sapdb://localhost/TST
-#hibernate.connection.username TEST
-#hibernate.connection.password TEST
-#hibernate.query.substitutions yes 'Y', no 'N'
-
-
-## MS SQL Server
-
-#hibernate.dialect org.hibernate.dialect.SQLServerDialect
-#hibernate.connection.username sa
-#hibernate.connection.password sa
-
-## JSQL Driver
-#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
-#hibernate.connection.url jdbc:JSQLConnect://1E1/test
-
-## JTURBO Driver
-#hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
-#hibernate.connection.url jdbc:JTurbo://1E1:1433/test
-
-## WebLogic Driver
-#hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
-#hibernate.connection.url jdbc:weblogic:mssqlserver4:1E1:1433
-
-## Microsoft Driver (not recommended!)
-#hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
-#hibernate.connection.url
jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor
-
-## jTDS (since version 0.9)
-#hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
-#hibernate.connection.url jdbc:jtds:sqlserver://1E1/test
-
-## Interbase
-
-#hibernate.dialect org.hibernate.dialect.InterbaseDialect
-#hibernate.connection.username sysdba
-#hibernate.connection.password masterkey
-
-## DO NOT specify hibernate.connection.sqlDialect
-
-## InterClient
-
-#hibernate.connection.driver_class interbase.interclient.Driver
-#hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb
-
-## Pure Java
-
-#hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
-#hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb
-
-
-## Pointbase
-
-#hibernate.dialect org.hibernate.dialect.PointbaseDialect
-#hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
-#hibernate.connection.url jdbc:pointbase:embedded:sample
-#hibernate.connection.username PBPUBLIC
-#hibernate.connection.password PBPUBLIC
-
-
-
-#################################
-### Hibernate Connection Pool ###
-#################################
-
-hibernate.connection.pool_size 1
-
-
-
-###########################
-### C3P0 Connection Pool###
-###########################
-
-#hibernate.c3p0.max_size 2
-#hibernate.c3p0.min_size 2
-#hibernate.c3p0.timeout 5000
-#hibernate.c3p0.max_statements 100
-#hibernate.c3p0.idle_test_period 3000
-#hibernate.c3p0.acquire_increment 2
-#hibernate.c3p0.validate false
-
-
-
-##############################
-### Proxool Connection Pool###
-##############################
-
-## Properties for external configuration of Proxool
-
-hibernate.proxool.pool_alias pool1
-
-## Only need one of the following
-
-#hibernate.proxool.existing_pool true
-#hibernate.proxool.xml proxool.xml
-#hibernate.proxool.properties proxool.properties
-
-
-
-#################################
-### Plugin ConnectionProvider ###
-#################################
-
-## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in
ConnectionProvider using hueristics)
-
-#hibernate.connection.provider_class
org.hibernate.connection.DriverManagerConnectionProvider
-#hibernate.connection.provider_class
org.hibernate.connection.DatasourceConnectionProvider
-#hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
-#hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider
-#hibernate.connection.provider_class org.hibernate.connection.ProxoolConnectionProvider
-
-
-
-#######################
-### Transaction API ###
-#######################
-
-## Enable automatic flush during the JTA beforeCompletion() callback
-## (This setting is relevant with or without the Transaction API)
-
-#hibernate.transaction.flush_before_completion
-
-
-## Enable automatic session close at the end of transaction
-## (This setting is relevant with or without the Transaction API)
-
-#hibernate.transaction.auto_close_session
-
-
-## the Transaction API abstracts application code from the underlying JTA or JDBC
transactions
-
-#hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
-#hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
-
-
-## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in
JNDI
-## default is java:comp/UserTransaction
-## you do NOT need this setting if you specify
hibernate.transaction.manager_lookup_class
-
-#jta.UserTransaction jta/usertransaction
-#jta.UserTransaction javax.transaction.UserTransaction
-#jta.UserTransaction UserTransaction
-
-
-## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA
TransactionManager
-
-#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.JBossTransactionManagerLookup
-#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.WeblogicTransactionManagerLookup
-#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.WebSphereTransactionManagerLookup
-#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.OrionTransactionManagerLookup
-#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.ResinTransactionManagerLookup
-
-
-
-##############################
-### Miscellaneous Settings ###
-##############################
-
-## print all generated SQL to the console
-
-#hibernate.show_sql true
-
-
-## add comments to the generated SQL
-
-#hibernate.use_sql_comments true
-
-
-## generate statistics
-
-#hibernate.generate_statistics true
-
-
-## auto schema export
-
-#hibernate.hbm2ddl.auto create-drop
-#hibernate.hbm2ddl.auto create
-#hibernate.hbm2ddl.auto update
-
-
-## specify a default schema and catalog for unqualified tablenames
-
-#hibernate.default_schema test
-#hibernate.default_catalog test
-
-
-## enable ordering of SQL UPDATEs by primary key
-
-hibernate.order_updates true
-
-
-## set the maximum depth of the outer join fetch tree
-
-hibernate.max_fetch_depth 1
-
-
-## set the default batch size for batch fetching
-
-hibernate.default_batch_fetch_size 100
-
-
-## rollback generated identifier values of deleted entities to default values
-
-#hibernate.use_identifer_rollback true
-
-
-## enable CGLIB reflection optimizer (enabled by default)
-
-#hibernate.cglib.use_reflection_optimizer false
-
-
-
-#####################
-### JDBC Settings ###
-#####################
-
-## specify a JDBC isolation level
-
-#hibernate.connection.isolation 4
-
-
-## enable JDBC autocommit (not recommended!)
-
-#hibernate.connection.autocommit true
-
-
-## set the JDBC fetch size
-
-#hibernate.jdbc.fetch_size 25
-
-
-## set the maximum JDBC 2 batch size (a nonzero value enables batching)
-
-#hibernate.jdbc.batch_size 0
-
-
-## enable batch updates even for versioned data
-
-hibernate.jdbc.batch_versioned_data true
-
-
-## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate
to use a sensible default)
-
-#hibernate.jdbc.use_scrollable_resultset true
-
-
-## use streams when writing binary types to / from JDBC
-
-hibernate.jdbc.use_streams_for_binary true
-
-
-## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted
row
-
-#hibernate.jdbc.use_get_generated_keys false
-
-
-## choose a custom JDBC batcher
-
-# hibernate.jdbc.factory_class
-
-
-## enable JDBC result set column alias caching
-## (minor performance enhancement for broken JDBC drivers)
-
-# hibernate.jdbc.wrap_result_sets
-
-
-## choose a custom SQL exception converter
-
-#hibernate.jdbc.sql_exception_converter
-
-
-
-##########################
-### Second-level Cache ###
-##########################
-
-## optimize chache for minimal "puts" instead of minimal "gets" (good
for clustered cache)
-
-#hibernate.cache.use_minimal_puts true
-
-
-## set a prefix for cache region names
-
-hibernate.cache.region_prefix hibernate.test
-
-
-## disable the second-level cache
-
-#hibernate.cache.use_second_level_cache false
-
-
-## enable the query cache
-
-hibernate.cache.use_query_cache true
-
-
-## store the second-level cache entries in a more human-friendly format
-
-#hibernate.cache.use_structured_entries true
-
-
-## choose a cache implementation
-
-#hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
-#hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
-hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
-#hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
-#hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
-#hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider
-
-
-## choose a custom query cache implementation
-
-#hibernate.cache.query_cache_factory
-
-
-
-############
-### JNDI ###
-############
-
-## specify a JNDI name for the SessionFactory
-
-#hibernate.session_factory_name hibernate/session_factory
-
-
-## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA
UserTransaction;
-## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext()
which
-## is the best approach in an application server
-
-#file system
-#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
-#hibernate.jndi.url file:/
-
-#WebSphere
-#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
-#hibernate.jndi.url iiop://localhost:900/
-
Deleted: annotations/trunk/src/test/log4j.properties
===================================================================
--- annotations/trunk/src/test/log4j.properties 2008-08-11 08:59:29 UTC (rev 15024)
+++ annotations/trunk/src/test/log4j.properties 2008-08-11 09:14:39 UTC (rev 15025)
@@ -1,51 +0,0 @@
-### direct log messages to stdout ###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### direct messages to file hibernate.log ###
-log4j.appender.file=org.apache.log4j.FileAppender
-log4j.appender.file.File=hibernate.log
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### direct messages to socket - chainsaw ###
-log4j.appender.socket=org.apache.log4j.net.SocketAppender
-log4j.appender.socket.remoteHost=localhost
-log4j.appender.socket.port=4560
-log4j.appender.socket.locationInfo=true
-
-
-### set log levels - for more verbose logging change 'info' to 'debug'
###
-
-log4j.rootLogger=warn, stdout
-
-log4j.logger.org.hibernate=debug
-
-
-### log just the SQL
-log4j.logger.org.hibernate.SQL=debug
-
-#log4j.logger.org.hibernate.engine.CascadingAction=debug
-
-### log JDBC bind parameters ###
-log4j.logger.org.hibernate.type=debug
-
-### log schema export/update ###
-log4j.logger.org.hibernate.tool.hbm2ddl=debug
-
-### log cache activity ###
-log4j.logger.org.hibernate.cache=debug
-
-### enable the following line if you want to track down connection ###
-### leakages when using DriverManagerConnectionProvider ###
-#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
-
-### annotation logs
-#log4j.logger.org.hibernate.annotation=info
-#log4j.logger.org.hibernate.cfg=info
-#log4j.logger.org.hibernate.cfg.SettingsFactory=info
-#log4j.logger.org.hibernate.cfg.AnnotationBinder=info
-#log4j.logger.org.hibernate.cfg.AnnotationConfiguration=info
-#log4j.logger.org.hibernate.cfg.Ejb3Column=info
\ No newline at end of file
Modified: annotations/trunk/src/test/org/hibernate/test/annotations/EntityTest.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/EntityTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/EntityTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -57,6 +57,19 @@
Transaction tx = s.beginTransaction();
Flight firstOne = new Flight();
firstOne.setId( new Long( 1 ) );
+ firstOne.setName( "AF3202" );
+ firstOne.setDuration( new Long( 1000000 ) );
+ firstOne.setDurationInSec( 2000 );
+ s.save( firstOne );
+ s.flush();
+ tx.commit();
+ s.close();
+
+
+ s = openSession();
+ tx = s.beginTransaction();
+ firstOne = new Flight();
+ firstOne.setId( new Long( 1 ) );
firstOne.setName( null );
try {
Added: annotations/trunk/src/test/org/hibernate/test/annotations/RequiresDialect.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/RequiresDialect.java
(rev 0)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/RequiresDialect.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -0,0 +1,20 @@
+// $Id:$
+package org.hibernate.test.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.hibernate.dialect.Dialect;
+
+/**
+ * Annotations used to mark a test to be specific to a given dialect.
+ *
+ * @author Hardy Ferentschik
+ */
+(a)Target({ElementType.METHOD, ElementType.TYPE})
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface RequiresDialect {
+ Class<? extends Dialect>[] value();
+}
Property changes on:
annotations/trunk/src/test/org/hibernate/test/annotations/RequiresDialect.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: annotations/trunk/src/test/org/hibernate/test/annotations/TestCase.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/TestCase.java 2008-08-11
08:59:29 UTC (rev 15024)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/TestCase.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -2,99 +2,194 @@
package org.hibernate.test.annotations;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
import org.hibernate.HibernateException;
+import org.hibernate.Interceptor;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.hibernate.Interceptor;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.Dialect;
+import org.hibernate.jdbc.Work;
+import org.hibernate.tool.hbm2ddl.SchemaExport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * A base class for all tests.
+ *
+ * @author Emmnauel Bernand
+ * @author Hardy Ferentschik
+ */
public abstract class TestCase extends junit.framework.TestCase {
+ public static final Logger log = LoggerFactory.getLogger(TestCase.class);
+
private static SessionFactory sessions;
private static AnnotationConfiguration cfg;
private static Dialect dialect;
- private static Class lastTestClass;
+ private static Class<?> lastTestClass;
private Session session;
+ /**
+ * The test method.
+ */
+ private Method runMethod = null;
+
+ /**
+ * Flag indicating whether the test should be skipped.
+ */
+ private boolean skip = false;
+
public TestCase() {
super();
}
public TestCase(String x) {
- super( x );
+ super(x);
}
- protected void buildSessionFactory(Class[] classes, String[] packages, String[]
xmlFiles) throws Exception {
+ protected void buildSessionFactory( Class<?>[] classes, String[] packages,
String[] xmlFiles ) throws Exception {
- if ( getSessions() != null ) getSessions().close();
+ if ( getSessions() != null )
+ getSessions().close();
try {
- setCfg( new AnnotationConfiguration() );
- configure( cfg );
+ setCfg(new AnnotationConfiguration());
+ configure(cfg);
if ( recreateSchema() ) {
- cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
+ cfg.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
}
- for ( int i = 0; i < packages.length ; i++ ) {
- getCfg().addPackage( packages[i] );
+ for ( int i = 0; i < packages.length; i++ ) {
+ getCfg().addPackage(packages[i]);
}
- for ( int i = 0; i < classes.length ; i++ ) {
- getCfg().addAnnotatedClass( classes[i] );
+ for ( int i = 0; i < classes.length; i++ ) {
+ getCfg().addAnnotatedClass(classes[i]);
}
- for ( int i = 0; i < xmlFiles.length ; i++ ) {
- InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(
xmlFiles[i] );
- getCfg().addInputStream( is );
+ for ( int i = 0; i < xmlFiles.length; i++ ) {
+ InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream(xmlFiles[i]);
+ getCfg().addInputStream(is);
}
- setDialect( Dialect.getDialect() );
- setSessions( getCfg().buildSessionFactory( /*new TestInterceptor()*/ ) );
- }
- catch (Exception e) {
+ setDialect(Dialect.getDialect());
+ setSessions(getCfg().buildSessionFactory( /* new TestInterceptor() */));
+ } catch ( Exception e ) {
e.printStackTrace();
throw e;
}
}
protected void setUp() throws Exception {
- if ( getSessions() == null || lastTestClass != getClass() ) {
- buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
- lastTestClass = getClass();
+ runMethod = findTestMethod();
+ checkSkip(runMethod);
+ if ( !skip ) {
+ if ( getSessions() == null || lastTestClass != getClass() ) {
+ buildSessionFactory(getMappings(), getAnnotatedPackages(), getXmlFiles());
+ lastTestClass = getClass();
+ } else {
+ runSchemaGeneration();
+ }
}
}
-
+
protected void runTest() throws Throwable {
try {
- super.runTest();
+ if ( !skip ) {
+ runTestMethod(runMethod);
+ handleUnclosedSession();
+ }
+ } catch ( Throwable e ) {
+ closeSession(e);
+ }
+ }
+
+ private void checkSkip( Method runMethod ) {
+ Set<Class<? extends Dialect>> dialectList = new HashSet<Class<?
extends Dialect>>();
+
+ RequiresDialect requiresDialectMethodAnn =
runMethod.getAnnotation(RequiresDialect.class);
+ if ( requiresDialectMethodAnn != null ) {
+ Class<? extends Dialect>[] requiredDialects = requiresDialectMethodAnn.value();
+ dialectList.addAll(Arrays.asList(requiredDialects));
+ }
+
+ RequiresDialect requiresDialectClassAnn =
getClass().getAnnotation(RequiresDialect.class);
+ if ( requiresDialectClassAnn != null ) {
+ Class<? extends Dialect>[] requiredDialects = requiresDialectClassAnn.value();
+ dialectList.addAll(Arrays.asList(requiredDialects));
+ }
+
+ if ( dialectList.isEmpty() || dialectList.contains(Dialect.getDialect().getClass()) )
{
+ skip = false;
+ } else {
+ log.warn("Skipping test {}, because test does not apply for dialect {}",
runMethod.getName(), Dialect
+ .getDialect().getClass());
+ skip = true;
+ }
+ }
+
+ private void runTestMethod( Method runMethod ) throws Throwable, IllegalAccessException
{
+ try {
+ runMethod.invoke(this, new Class[0]);
+ } catch ( InvocationTargetException e ) {
+ e.fillInStackTrace();
+ throw e.getTargetException();
+ } catch ( IllegalAccessException e ) {
+ e.fillInStackTrace();
+ throw e;
+ }
+ }
+
+ private Method findTestMethod() {
+ String fName = getName();
+ assertNotNull(fName);
+ Method runMethod = null;
+ try {
+ runMethod = getClass().getMethod(fName, null);
+ } catch ( NoSuchMethodException e ) {
+ fail("Method \"" + fName + "\" not found");
+ }
+ if ( !Modifier.isPublic(runMethod.getModifiers()) ) {
+ fail("Method \"" + fName + "\" should be public");
+ }
+ return runMethod;
+ }
+
+ private void handleUnclosedSession() {
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() )
+ session.doWork(new RollbackWork());
+ session.close();
+ session = null;
+ fail("unclosed session");
+ } else {
+ session = null;
+ }
+ }
+
+ private void closeSession( Throwable e ) throws Throwable {
+ try {
if ( session != null && session.isOpen() ) {
- if ( session.isConnected() ) session.connection().rollback();
+ if ( session.isConnected() )
+ session.doWork(new RollbackWork());
session.close();
- session = null;
- fail( "unclosed session" );
}
- else {
- session = null;
- }
+ } catch ( Exception ignore ) {
}
- catch (Throwable e) {
- try {
- if ( session != null && session.isOpen() ) {
- if ( session.isConnected() ) session.connection().rollback();
- session.close();
- }
+ try {
+ if ( sessions != null ) {
+ sessions.close();
+ sessions = null;
}
- catch (Exception ignore) {
- }
- try {
- if ( sessions != null ) {
- sessions.close();
- sessions = null;
- }
- }
- catch (Exception ignore) {
- }
- throw e;
+ } catch ( Exception ignore ) {
}
+ throw e;
}
public Session openSession() throws HibernateException {
@@ -102,22 +197,22 @@
return session;
}
- public Session openSession(Interceptor interceptor) throws HibernateException {
+ public Session openSession( Interceptor interceptor ) throws HibernateException {
session = getSessions().openSession(interceptor);
return session;
}
- protected abstract Class[] getMappings();
+ protected abstract Class<?>[] getMappings();
protected String[] getAnnotatedPackages() {
- return new String[]{};
+ return new String[] {};
}
protected String[] getXmlFiles() {
- return new String[]{};
+ return new String[] {};
}
- private void setSessions(SessionFactory sessions) {
+ private void setSessions( SessionFactory sessions ) {
TestCase.sessions = sessions;
}
@@ -125,7 +220,7 @@
return sessions;
}
- private void setDialect(Dialect dialect) {
+ private void setDialect( Dialect dialect ) {
TestCase.dialect = dialect;
}
@@ -133,7 +228,7 @@
return dialect;
}
- protected static void setCfg(AnnotationConfiguration cfg) {
+ protected static void setCfg( AnnotationConfiguration cfg ) {
TestCase.cfg = cfg;
}
@@ -141,14 +236,22 @@
return cfg;
}
- protected void configure(Configuration cfg) {
- //cfg.setNamingStrategy( AlternativeNamingStrategy.INSTANCE );
- //cfg.getSessionEventListenerConfig().setFlushEventListener( new
EJB3FlushEventListener() );
- //cfg.getSessionEventListenerConfig().setAutoFlushEventListener( new
EJB3AutoFlushEventListener() );
+ protected void configure( Configuration cfg ) {
}
protected boolean recreateSchema() {
return true;
}
+ protected void runSchemaGeneration() {
+ SchemaExport export = new SchemaExport(cfg);
+ export.create(true, true);
+ }
+
+ public class RollbackWork implements Work {
+
+ public void execute( Connection connection ) throws SQLException {
+ connection.rollback();
+ }
+ }
}
Modified:
annotations/trunk/src/test/org/hibernate/test/annotations/access/AccessTest.java
===================================================================
---
annotations/trunk/src/test/org/hibernate/test/annotations/access/AccessTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/access/AccessTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -9,7 +9,7 @@
* @author Emmanuel Bernard
*/
public class AccessTest extends TestCase {
-
+
public void testSuperclassOverriding() throws Exception {
Furniture fur = new Furniture();
fur.setColor( "Black" );
Modified: annotations/trunk/src/test/org/hibernate/test/annotations/id/IdTest.java
===================================================================
--- annotations/trunk/src/test/org/hibernate/test/annotations/id/IdTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++ annotations/trunk/src/test/org/hibernate/test/annotations/id/IdTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -3,7 +3,9 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.HSQLDialect;
import org.hibernate.mapping.Column;
+import org.hibernate.test.annotations.RequiresDialect;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.annotations.id.entities.Ball;
import org.hibernate.test.annotations.id.entities.BreakDance;
@@ -27,13 +29,9 @@
* @author Emmanuel Bernard
*/
@SuppressWarnings("unchecked")
+(a)RequiresDialect(HSQLDialect.class)
public class IdTest extends TestCase {
// FIXME split Sequence and Id tests to explicit the run failure on Oracle etc
-
- public IdTest(String x) {
- super(x);
- }
-
public void testGenericGenerator() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
Modified:
annotations/trunk/src/test/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java
===================================================================
---
annotations/trunk/src/test/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -9,6 +9,8 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.Hibernate;
+import org.hibernate.dialect.HSQLDialect;
+import org.hibernate.test.annotations.RequiresDialect;
import org.hibernate.test.annotations.TestCase;
/**
@@ -254,6 +256,7 @@
s.close();
}
+ @RequiresDialect(HSQLDialect.class)
public void testComponentSubPropertyMapKey() throws Exception {
Session s;
Transaction tx;
Modified: annotations/trunk/src/test/org/hibernate/test/annotations/join/JoinTest.java
===================================================================
---
annotations/trunk/src/test/org/hibernate/test/annotations/join/JoinTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/join/JoinTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -17,10 +17,6 @@
*/
public class JoinTest extends TestCase {
- public JoinTest(String x) {
- super( x );
- }
-
public void testDefaultValue() throws Exception {
Join join = (Join) getCfg().getClassMapping( Life.class.getName()
).getJoinClosureIterator().next();
assertEquals( "ExtendedLife", join.getTable().getName() );
Modified:
annotations/trunk/src/test/org/hibernate/test/annotations/manytomany/ManyToManyTest.java
===================================================================
---
annotations/trunk/src/test/org/hibernate/test/annotations/manytomany/ManyToManyTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/manytomany/ManyToManyTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -14,6 +14,8 @@
import org.hibernate.JDBCException;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.HSQLDialect;
+import org.hibernate.test.annotations.RequiresDialect;
import org.hibernate.test.annotations.TestCase;
/**
@@ -79,6 +81,7 @@
s.close();
}
+ @RequiresDialect(HSQLDialect.class)
public void testDefaultCompositePk() throws Exception {
Session s;
Transaction tx;
@@ -282,6 +285,7 @@
*
*
*/
+ @RequiresDialect(HSQLDialect.class)
public void testOrderByContractor() throws Exception {
Session s;
@@ -419,6 +423,7 @@
s.close();
}
+ @RequiresDialect(HSQLDialect.class)
public void testCompositePk() throws Exception {
Session s;
Transaction tx;
Modified:
annotations/trunk/src/test/org/hibernate/test/annotations/onetomany/OneToManyTest.java
===================================================================
---
annotations/trunk/src/test/org/hibernate/test/annotations/onetomany/OneToManyTest.java 2008-08-11
08:59:29 UTC (rev 15024)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/onetomany/OneToManyTest.java 2008-08-11
09:14:39 UTC (rev 15025)
@@ -12,9 +12,11 @@
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.HSQLDialect;
import org.hibernate.test.annotations.Customer;
import org.hibernate.test.annotations.Discount;
import org.hibernate.test.annotations.Passport;
+import org.hibernate.test.annotations.RequiresDialect;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.annotations.Ticket;
import org.hibernate.test.annotations.TicketComparator;
@@ -379,6 +381,7 @@
s.close();
}
+ @RequiresDialect(HSQLDialect.class)
public void testOrderByOnSuperclassProperty() {
OrganisationUser user = new OrganisationUser();
user.setFirstName( "Emmanuel" );
Copied: annotations/trunk/src/test-resources/ehcache.xml (from rev 15019,
annotations/trunk/src/test/ehcache.xml)
===================================================================
--- annotations/trunk/src/test-resources/ehcache.xml (rev 0)
+++ annotations/trunk/src/test-resources/ehcache.xml 2008-08-11 09:14:39 UTC (rev 15025)
@@ -0,0 +1,80 @@
+<ehcache>
+ <!-- Sets the path to the directory where cache .data files are created.
+ If the path is a Java System Property it is replaced by
+ its value in the running VM.
+
+ The following properties are translated:
+ user.home - User's home directory
+ user.dir - User's current working directory
+ java.io.tmpdir - Default temp file path -->
+
+ <diskStore path="java.io.tmpdir"/>
+ <!--Default Cache configuration. These will applied to caches programmatically
created through
+ the CacheManager.
+ The following attributes are required for defaultCache:
+ maxInMemory - Sets the maximum number of objects that will be created in
memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is
only used
+ if the element is not eternal. Idle time is now - last
accessed time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is
only used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
+ has reached the maxInMemory limit.
+
+ -->
+
+ <defaultCache
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="120"
+ timeToLiveSeconds="120"
+ overflowToDisk="true"
+ />
+ <!--Predefined caches. Add your cache configuration settings here.
+ If you do not have a configuration for your cache a WARNING will be issued when
the
+ CacheManager starts
+ The following attributes are required for defaultCache:
+ name - Sets the name of the cache. This is used to identify the
cache. It must be unique.
+ maxInMemory - Sets the maximum number of objects that will be created in
memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is
only used
+ if the element is not eternal. Idle time is now - last
accessed time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is
only used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
+ has reached the maxInMemory limit.
+ -->
+
+ <!-- Sample cache named sampleCache1
+ This cache contains a maximum in memory of 10000 elements, and will expire
+ an element if it is idle for more than 5 minutes and lives for more than
+ 10 minutes.
+
+ If there are more than 10000 elements it will overflow to the
+ disk cache, which in this configuration will go to wherever java.io.tmp is
+ defined on your system. On a standard Linux system this will be /tmp"
+ -->
+
+ <cache name="sampleCache1"
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="300"
+ timeToLiveSeconds="600"
+ overflowToDisk="true"
+ />
+
+ <!-- Sample cache named sampleCache2
+ This cache contains 1000 elements. Elements will always be held in memory.
+ They are not expired. -->
+ <cache name="sampleCache2"
+ maxElementsInMemory="1000"
+ eternal="true"
+ timeToIdleSeconds="0"
+ timeToLiveSeconds="0"
+ overflowToDisk="false"
+ />
+
+ <!-- Place configuration for your caches following -->
+</ehcache>
\ No newline at end of file
Added: annotations/trunk/src/test-resources/hibernate.properties
===================================================================
--- annotations/trunk/src/test-resources/hibernate.properties (rev
0)
+++ annotations/trunk/src/test-resources/hibernate.properties 2008-08-11 09:14:39 UTC (rev
15025)
@@ -0,0 +1,301 @@
+######################
+### Query Language ###
+######################
+
+## define query language constants / function names
+
+hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
+
+
+## select the classic query parser
+
+#hibernate.query.factory_class org.hibernate.hql.classic.ClassicQueryTranslatorFactory
+
+hibernate.format_sql true
+
+
+
+#################
+### Platforms ###
+#################
+
+hibernate.dialect @hibernate.dialect@
+hibernate.connection.driver_class @hibernate.connection.driver_class@
+hibernate.connection.username @hibernate.connection.username@
+hibernate.connection.password @hibernate.connection.password@
+hibernate.connection.url @hibernate.connection.url@
+
+#################################
+### Hibernate Connection Pool ###
+#################################
+
+hibernate.connection.pool_size 1
+
+###########################
+### C3P0 Connection Pool###
+###########################
+
+#hibernate.c3p0.max_size 2
+#hibernate.c3p0.min_size 2
+#hibernate.c3p0.timeout 5000
+#hibernate.c3p0.max_statements 100
+#hibernate.c3p0.idle_test_period 3000
+#hibernate.c3p0.acquire_increment 2
+#hibernate.c3p0.validate false
+
+##############################
+### Proxool Connection Pool###
+##############################
+
+## Properties for external configuration of Proxool
+
+hibernate.proxool.pool_alias pool1
+
+## Only need one of the following
+
+#hibernate.proxool.existing_pool true
+#hibernate.proxool.xml proxool.xml
+#hibernate.proxool.properties proxool.properties
+
+
+
+#################################
+### Plugin ConnectionProvider ###
+#################################
+
+## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in
ConnectionProvider using hueristics)
+
+#hibernate.connection.provider_class
org.hibernate.connection.DriverManagerConnectionProvider
+#hibernate.connection.provider_class
org.hibernate.connection.DatasourceConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.ProxoolConnectionProvider
+
+
+
+#######################
+### Transaction API ###
+#######################
+
+## Enable automatic flush during the JTA beforeCompletion() callback
+## (This setting is relevant with or without the Transaction API)
+
+#hibernate.transaction.flush_before_completion
+
+
+## Enable automatic session close at the end of transaction
+## (This setting is relevant with or without the Transaction API)
+
+#hibernate.transaction.auto_close_session
+
+
+## the Transaction API abstracts application code from the underlying JTA or JDBC
transactions
+
+#hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
+#hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
+
+
+## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in
JNDI
+## default is java:comp/UserTransaction
+## you do NOT need this setting if you specify
hibernate.transaction.manager_lookup_class
+
+#jta.UserTransaction jta/usertransaction
+#jta.UserTransaction javax.transaction.UserTransaction
+#jta.UserTransaction UserTransaction
+
+
+## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA
TransactionManager
+
+#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.WeblogicTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.WebSphereTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.OrionTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class
org.hibernate.transaction.ResinTransactionManagerLookup
+
+
+
+##############################
+### Miscellaneous Settings ###
+##############################
+
+## print all generated SQL to the console
+
+#hibernate.show_sql true
+
+
+## add comments to the generated SQL
+
+#hibernate.use_sql_comments true
+
+
+## generate statistics
+
+#hibernate.generate_statistics true
+
+
+## auto schema export
+
+#hibernate.hbm2ddl.auto create-drop
+#hibernate.hbm2ddl.auto create
+#hibernate.hbm2ddl.auto update
+
+
+## specify a default schema and catalog for unqualified tablenames
+
+#hibernate.default_schema test
+#hibernate.default_catalog test
+
+
+## enable ordering of SQL UPDATEs by primary key
+
+hibernate.order_updates true
+
+
+## set the maximum depth of the outer join fetch tree
+
+hibernate.max_fetch_depth 1
+
+
+## set the default batch size for batch fetching
+
+hibernate.default_batch_fetch_size 100
+
+
+## rollback generated identifier values of deleted entities to default values
+
+#hibernate.use_identifer_rollback true
+
+
+## enable CGLIB reflection optimizer (enabled by default)
+
+#hibernate.cglib.use_reflection_optimizer false
+
+
+
+#####################
+### JDBC Settings ###
+#####################
+
+## specify a JDBC isolation level
+
+#hibernate.connection.isolation 4
+
+
+## enable JDBC autocommit (not recommended!)
+
+#hibernate.connection.autocommit true
+
+
+## set the JDBC fetch size
+
+#hibernate.jdbc.fetch_size 25
+
+
+## set the maximum JDBC 2 batch size (a nonzero value enables batching)
+
+#hibernate.jdbc.batch_size 0
+
+
+## enable batch updates even for versioned data
+
+hibernate.jdbc.batch_versioned_data true
+
+
+## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate
to use a sensible default)
+
+#hibernate.jdbc.use_scrollable_resultset true
+
+
+## use streams when writing binary types to / from JDBC
+
+hibernate.jdbc.use_streams_for_binary true
+
+
+## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted
row
+
+#hibernate.jdbc.use_get_generated_keys false
+
+
+## choose a custom JDBC batcher
+
+# hibernate.jdbc.factory_class
+
+
+## enable JDBC result set column alias caching
+## (minor performance enhancement for broken JDBC drivers)
+
+# hibernate.jdbc.wrap_result_sets
+
+
+## choose a custom SQL exception converter
+
+#hibernate.jdbc.sql_exception_converter
+
+
+
+##########################
+### Second-level Cache ###
+##########################
+
+## optimize chache for minimal "puts" instead of minimal "gets" (good
for clustered cache)
+
+#hibernate.cache.use_minimal_puts true
+
+
+## set a prefix for cache region names
+
+hibernate.cache.region_prefix hibernate.test
+
+
+## disable the second-level cache
+
+#hibernate.cache.use_second_level_cache false
+
+
+## enable the query cache
+
+hibernate.cache.use_query_cache true
+
+
+## store the second-level cache entries in a more human-friendly format
+
+#hibernate.cache.use_structured_entries true
+
+
+## choose a cache implementation
+
+#hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
+hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider
+
+
+## choose a custom query cache implementation
+
+#hibernate.cache.query_cache_factory
+
+
+
+############
+### JNDI ###
+############
+
+## specify a JNDI name for the SessionFactory
+
+#hibernate.session_factory_name hibernate/session_factory
+
+
+## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA
UserTransaction;
+## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext()
which
+## is the best approach in an application server
+
+#file system
+#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
+#hibernate.jndi.url file:/
+
+#WebSphere
+#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
+#hibernate.jndi.url iiop://localhost:900/
+
Property changes on: annotations/trunk/src/test-resources/hibernate.properties
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Copied: annotations/trunk/src/test-resources/log4j.properties (from rev 15019,
annotations/trunk/src/test/log4j.properties)
===================================================================
--- annotations/trunk/src/test-resources/log4j.properties (rev 0)
+++ annotations/trunk/src/test-resources/log4j.properties 2008-08-11 09:14:39 UTC (rev
15025)
@@ -0,0 +1,51 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to file hibernate.log ###
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=hibernate.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to socket - chainsaw ###
+log4j.appender.socket=org.apache.log4j.net.SocketAppender
+log4j.appender.socket.remoteHost=localhost
+log4j.appender.socket.port=4560
+log4j.appender.socket.locationInfo=true
+
+
+### set log levels - for more verbose logging change 'info' to 'debug'
###
+
+log4j.rootLogger=warn, stdout
+
+log4j.logger.org.hibernate=debug
+
+
+### log just the SQL
+log4j.logger.org.hibernate.SQL=debug
+
+#log4j.logger.org.hibernate.engine.CascadingAction=debug
+
+### log JDBC bind parameters ###
+log4j.logger.org.hibernate.type=debug
+
+### log schema export/update ###
+log4j.logger.org.hibernate.tool.hbm2ddl=debug
+
+### log cache activity ###
+log4j.logger.org.hibernate.cache=debug
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
+
+### annotation logs
+#log4j.logger.org.hibernate.annotation=info
+#log4j.logger.org.hibernate.cfg=info
+#log4j.logger.org.hibernate.cfg.SettingsFactory=info
+#log4j.logger.org.hibernate.cfg.AnnotationBinder=info
+#log4j.logger.org.hibernate.cfg.AnnotationConfiguration=info
+#log4j.logger.org.hibernate.cfg.Ejb3Column=info
\ No newline at end of file