From: <hib...@li...> - 2006-03-29 15:59:24
|
Author: max...@jb... Date: 2006-03-29 10:58:38 -0500 (Wed, 29 Mar 2006) New Revision: 9715 Modified: trunk/HibernateExt/tools/lib/testlibs/ejb3-persistence.jar trunk/HibernateExt/tools/lib/testlibs/hibernate-annotations.jar trunk/HibernateExt/tools/lib/testlibs/hibernate3.jar trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/Hbm2DDLExporterTask.java trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/HibernateToolTask.java trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/BuildFileTestCase.java trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/HibernateToolTest.java trunk/HibernateExt/tools/src/testsupport/anttest-build.xml Log: HBX-632 Provide <ejb3configuration> support in Ant Modified: trunk/HibernateExt/tools/lib/testlibs/ejb3-persistence.jar =================================================================== (Binary files differ) Modified: trunk/HibernateExt/tools/lib/testlibs/hibernate-annotations.jar =================================================================== (Binary files differ) Modified: trunk/HibernateExt/tools/lib/testlibs/hibernate3.jar =================================================================== (Binary files differ) Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/Hbm2DDLExporterTask.java =================================================================== --- trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/Hbm2DDLExporterTask.java 2006-03-29 14:35:31 UTC (rev 9714) +++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/Hbm2DDLExporterTask.java 2006-03-29 15:58:38 UTC (rev 9715) @@ -5,6 +5,8 @@ package org.hibernate.tool.ant; import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; import java.util.Iterator; import org.apache.tools.ant.BuildException; @@ -61,7 +63,11 @@ parent.log(export.getExceptions().size() + " errors occurred while performing <hbm2ddl>.", Project.MSG_WARN); while ( iterator.hasNext() ) { Throwable throwable = (Throwable) iterator.next(); - parent.log("Error #" + cnt + ": " + throwable.toString(), Project.MSG_WARN); + parent.log("Error #" + cnt + ": " + throwable.toString(), Project.MSG_WARN); + StringWriter sw = new StringWriter(); + throwable.printStackTrace(new PrintWriter(sw)); + parent.log(sw.getBuffer().toString(), Project.MSG_VERBOSE); + } if(haltOnError) { throw new BuildException("Errors while performing <hbm2ddl>"); Modified: trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/HibernateToolTask.java =================================================================== --- trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/HibernateToolTask.java 2006-03-29 14:35:31 UTC (rev 9714) +++ trunk/HibernateExt/tools/src/java/org/hibernate/tool/ant/HibernateToolTask.java 2006-03-29 15:58:38 UTC (rev 9715) @@ -58,6 +58,12 @@ return (AnnotationConfigurationTask) configurationTask; } + public EJB3ConfigurationTask createEjb3Configuration() { + checkConfiguration(); + configurationTask = new EJB3ConfigurationTask(); + return (EJB3ConfigurationTask) configurationTask; + } + public ExporterTask createHbm2DDL() { ExporterTask generator = new Hbm2DDLExporterTask(this); generators.add(generator); Modified: trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/BuildFileTestCase.java =================================================================== --- trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/BuildFileTestCase.java 2006-03-29 14:35:31 UTC (rev 9714) +++ trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/BuildFileTestCase.java 2006-03-29 15:58:38 UTC (rev 9715) @@ -237,7 +237,7 @@ System.setErr(err); logBuffer = new StringBuffer(); fullLogBuffer = new StringBuffer(); - buildException = null; + buildException = null; project.executeTarget(targetName); } catch (BuildException be) { Modified: trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/HibernateToolTest.java =================================================================== --- trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/HibernateToolTest.java 2006-03-29 14:35:31 UTC (rev 9714) +++ trunk/HibernateExt/tools/src/test/org/hibernate/tool/ant/HibernateToolTest.java 2006-03-29 15:58:38 UTC (rev 9715) @@ -61,6 +61,15 @@ executeTarget("testantannotationcfg"); } + public void testEJB3ConfigurationFailureExpected() { + executeTarget("testantejb3cfg"); + File baseDir = new File(project.getProperty("build.dir")); + File ejb3 = new File(baseDir, "ejb3.sql"); + + assertTrue(ejb3.exists()); + assertEquals(null, TestHelper.findFirstString("drop", ejb3)); + } + public void testHbm2JavaConfiguration() { executeTarget("testanthbm2java"); } Modified: trunk/HibernateExt/tools/src/testsupport/anttest-build.xml =================================================================== --- trunk/HibernateExt/tools/src/testsupport/anttest-build.xml 2006-03-29 14:35:31 UTC (rev 9714) +++ trunk/HibernateExt/tools/src/testsupport/anttest-build.xml 2006-03-29 15:58:38 UTC (rev 9715) @@ -1,55 +1,54 @@ <project name="anttest"> - <property name="hibernate-core.jar" location="../../../../hibernate-3.1/hibernate3.jar"/> - <property name="hibernate-core.home" location="../../../../hibernate3"/> - <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/> - <property name="build.dir" location="../../build/anttest"/> - <property file="../../etc/hibernate.properties"/> + <property name="hibernate-core.jar" location="../../../../hibernate-3.1/hibernate3.jar" /> + <property name="hibernate-core.home" location="../../../../hibernate3" /> + <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib" /> + <property name="build.dir" location="../../build/anttest" /> + <property file="../../etc/hibernate.properties" /> - <delete dir="${build.dir}"/> - <path id="tasks.classpath"> - <pathelement path="../../build/eclipse"/> - <pathelement path="../../build/classes"/> + <path id="tasks.classpath"> + <pathelement path="../../build/eclipse" /> + <pathelement path="../../build/classes" /> - <fileset dir="${hibernate-core.lib.dir}"> - <include name="**/*.jar"/> - </fileset> - - <pathelement location="${hibernate-core.jar}"/> - <pathelement path="../../lib/freemarker.jar"/> - <pathelement path="${hibernate-core.home}\jdbc\hsqldb.jar"/> - </path> + <fileset dir="${hibernate-core.lib.dir}"> + <include name="**/*.jar" /> + </fileset> - -<target name="testantcfg"> - - <mkdir dir="build/testsupport"/> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"/> - <hibernatetool destdir="${build.dir}/topdown"> - <classpath> - <path location="../../build/testsupport"/> - </classpath> - - <configuration namingstrategy="org.hibernate.cfg.ImprovedNamingStrategy" entityresolver="DummyEntityResolver"> - <fileset dir="../test" id="id"> - <include name="**/*TopDown.hbm.xml"/> - </fileset> - </configuration> - - <hbm2java/> - <hbm2ddl drop="false" create="true" export="false" outputfilename="onlycreate.sql" format="true"/> - <hbm2ddl drop="true" create="false" export="false" outputfilename="onlydrop.sql" format="true"/> - <hbm2ddl drop="true" create="true" export="false" outputfilename="dropandcreate.sql" format="true"/> - <hbm2doc/> - </hibernatetool> - -</target> + <pathelement location="${hibernate-core.jar}" /> + <pathelement path="../../lib/freemarker.jar" /> + <pathelement path="${hibernate-core.home}\jdbc\hsqldb.jar" /> + </path> -<target name="testantjdbccfg"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> - <property file="../etc/hibernate.properties" prefix="tools"/> -<!-- + + <target name="testantcfg"> + + <mkdir dir="build/testsupport" /> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" /> + <hibernatetool destdir="${build.dir}/topdown"> + <classpath> + <path location="../../build/testsupport" /> + </classpath> + + <configuration namingstrategy="org.hibernate.cfg.ImprovedNamingStrategy" entityresolver="DummyEntityResolver"> + <fileset dir="../test" id="id"> + <include name="**/*TopDown.hbm.xml" /> + </fileset> + </configuration> + + <hbm2java /> + <hbm2ddl drop="false" create="true" export="false" outputfilename="onlycreate.sql" format="true" /> + <hbm2ddl drop="true" create="false" export="false" outputfilename="onlydrop.sql" format="true" /> + <hbm2ddl drop="true" create="true" export="false" outputfilename="dropandcreate.sql" format="true" /> + <hbm2doc /> + </hibernatetool> + + </target> + + <target name="testantjdbccfg"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + <property file="../etc/hibernate.properties" prefix="tools" /> + <!-- <sql onerror="continue" driver="${tools.hibernate.connection.driver_class}" password="${tools.hibernate.connection.password}" url="${tools.hibernate.connection.url}" userid="${tools.hibernate.connection.username}" classpath="C:\work\products\hsqldb-1.7.2.6\lib\hsqldb.jar"> create table BottomUp ( id bigint not null, @@ -57,243 +56,277 @@ primary key (id) ) </sql> --> - <hibernatetool destdir="${build.dir}/bottomup"> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties"/> - - <hbm2java/> - <hbm2java templatepath="templates"/> - <hbm2cfgxml/> - </hibernatetool> -</target> + <hibernatetool destdir="${build.dir}/bottomup"> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" /> - <target name="testantjdbccfgoverrides"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> - <property file="../etc/hibernate.properties" prefix="tools"/> - <!-- <sql onerror="continue" driver="${tools.hibernate.connection.driver_class}" password="${tools.hibernate.connection.password}" url="${tools.hibernate.connection.url}" userid="${tools.hibernate.connection.username}" classpath="C:\work\products\hsqldb-1.7.2.6\lib\hsqldb.jar"> + <hbm2java /> + <hbm2java templatepath="templates" /> + <hbm2cfgxml /> + </hibernatetool> + </target> + + <target name="testantjdbccfgoverrides"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + <property file="../etc/hibernate.properties" prefix="tools" /> + <!-- <sql onerror="continue" driver="${tools.hibernate.connection.driver_class}" password="${tools.hibernate.connection.password}" url="${tools.hibernate.connection.url}" userid="${tools.hibernate.connection.username}" classpath="C:\work\products\hsqldb-1.7.2.6\lib\hsqldb.jar"> create table BottomUp ( id bigint not null, name varchar(255), primary key (id) ) </sql> --> - <hibernatetool destdir="${build.dir}/bottomupoverride"> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packagename="test" revengfile="hibernate.reveng.xml"/> - - <hbm2java/> - </hibernatetool> - </target> - -<target name="testanthbm2java"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> - <hibernatetool destdir="${build.dir}/bottomup"> - <configuration propertyfile="../../etc/hibernate.properties"> - <fileset dir="."> - <include name="SomeClasses.hbm.xml"/> - </fileset> - </configuration> + <hibernatetool destdir="${build.dir}/bottomupoverride"> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packagename="test" revengfile="hibernate.reveng.xml" /> - <hbm2java jdk5="true"/> - </hibernatetool> -</target> + <hbm2java /> + </hibernatetool> + </target> - <property name="hbm2java.ejb3" value="weird"/> - <property name="hbm2java.anothervalue" value="weirdo"/> - - <target name="testproperties"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <target name="testanthbm2java"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + <hibernatetool destdir="${build.dir}/bottomup"> + <configuration propertyfile="../../etc/hibernate.properties"> + <fileset dir="."> + <include name="SomeClasses.hbm.xml" /> + </fileset> + </configuration> - <property name="org.hibernate.tool.hbm2x.weirdAl" value="weirdAl"/> - - <hibernatetool destdir="${build.dir}/bottomup"> - <configuration propertyfile="../../etc/hibernate.properties"> - <fileset dir="."> - <include name="SomeClasses.hbm.xml"/> - </fileset> - </configuration> + <hbm2java jdk5="true" /> + </hibernatetool> + </target> - <hbm2java jdk5="true"> - <propertyset> - <propertyref builtin="all"/> - <propertyref name="hbm2java.ejb3"/> - <propertyref prefix="hbm2java"/> - </propertyset> - <property key="mykey" file="c"/> - <property key="mykey" value="c"/> - </hbm2java> - </hibernatetool> - </target> + <property name="hbm2java.ejb3" value="weird" /> + <property name="hbm2java.anothervalue" value="weirdo" /> - <target name="testgeneric"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> - <hibernatetool destdir="${build.dir}/generic" templatepath="generictemplates"> - <configuration propertyfile="../../etc/hibernate.properties"> - <fileset dir="../test" id="id"> - <include name="**/*TopDown.hbm.xml"/> - </fileset> - </configuration> + <target name="testproperties"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> - <hbmtemplate templateprefix="pojo/" template="pojo/Pojo.ftl" filepattern="X{package-name}/{class-name}.java"> - <property key="jdk5" value="false"/> - <property key="ejb3" value="false"/> - </hbmtemplate> - <hbm2java/> - - <hbmtemplate template="pojo/generic-class.ftl" filepattern="{package-name}/{class-name}.quote"/> - <hbmtemplate exporterclass="org.hibernate.tool.hbm2x.POJOExporter" filepattern="{package-name}/{class-name}.quote"/> - </hibernatetool> - </target> + <property name="org.hibernate.tool.hbm2x.weirdAl" value="weirdAl" /> - <target name="testexceptions"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> - <hibernatetool destdir="${build.dir}/generic" templatepath="generictemplates"> - <configuration propertyfile="../../etc/hibernate.properties"> - <fileset dir="../test" id="id"> - <include name="**/*TopDown.hbm.xml"/> - </fileset> - </configuration> + <hibernatetool destdir="${build.dir}/bottomup"> + <configuration propertyfile="../../etc/hibernate.properties"> + <fileset dir="."> + <include name="SomeClasses.hbm.xml" /> + </fileset> + </configuration> - <hbmtemplate template="generic-exception.ftl" filepattern="{package-name}/{class-name}.error"/> - </hibernatetool> - </target> - -<target name="testantannotationcfg"> - <path id="annlib"> - <path location="${hibernate-core.jar}"/> - <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar"/> - <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar"/> - <path location="${build.dir}/../classes"/> - <path location="${build.dir}/../../etc"/> - <path location="${hibernate-core.home}\jdbc\hsqldb.jar"/> - <fileset dir="${hibernate-core.lib.dir}"> - <include name="*.jar"/> - </fileset> - </path> - <taskdef name="hibernatetoolx" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib"/> - <hibernatetoolx destdir="${build.dir}/bottomup"> - <annotationconfiguration configurationfile="test-hibernate.cfg.xml"/> - <hbm2ddl console="true" export="false"/> - </hibernatetoolx> -</target> + <hbm2java jdk5="true"> + <propertyset> + <propertyref builtin="all" /> + <propertyref name="hbm2java.ejb3" /> + <propertyref prefix="hbm2java" /> + </propertyset> + <property key="mykey" file="c" /> + <property key="mykey" value="c" /> + </hbm2java> + </hibernatetool> + </target> -<target name="testantejb3hbm2java"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <target name="testgeneric"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + <hibernatetool destdir="${build.dir}/generic" templatepath="generictemplates"> + <configuration propertyfile="../../etc/hibernate.properties"> + <fileset dir="../test" id="id"> + <include name="**/*TopDown.hbm.xml" /> + </fileset> + </configuration> -<hibernatetool destdir="${build.dir}/bottomup"> - <configuration propertyfile="../../etc/hibernate.properties"> - <fileset dir="../test/org/hibernate/tool/hbm2x"> - <include name="**/*.hbm.xml"/> - </fileset> - </configuration> + <hbmtemplate templateprefix="pojo/" template="pojo/Pojo.ftl" filepattern="X{package-name}/{class-name}.java"> + <property key="jdk5" value="false" /> + <property key="ejb3" value="false" /> + </hbmtemplate> + <hbm2java /> - <hbm2java ejb3="true"/> -</hibernatetool> + <hbmtemplate template="pojo/generic-class.ftl" filepattern="{package-name}/{class-name}.quote" /> + <hbmtemplate exporterclass="org.hibernate.tool.hbm2x.POJOExporter" filepattern="{package-name}/{class-name}.quote" /> + </hibernatetool> + </target> -</target> + <target name="testexceptions"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + <hibernatetool destdir="${build.dir}/generic" templatepath="generictemplates"> + <configuration propertyfile="../../etc/hibernate.properties"> + <fileset dir="../test" id="id"> + <include name="**/*TopDown.hbm.xml" /> + </fileset> + </configuration> -<target name="prepareCfg2hbm" description="prepare for cfg2hbm tasks"> - <sql onerror="continue" - driver="${hibernate.connection.driver_class}" - url="${hibernate.connection.url}" - userid="${hibernate.connection.username}" - password="${hibernate.connection.password}" - classpath="${hibernate-core.lib.dir}/hsqldb-1.7.3.3.jar"> - create table VeriSimplyTable ( id bigint not null, name varchar(255), primary key (id) ) + <hbmtemplate template="generic-exception.ftl" filepattern="{package-name}/{class-name}.error" /> + </hibernatetool> + </target> + + <target name="testantannotationcfg"> + <path id="annlib"> + <path location="${hibernate-core.jar}" /> + <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" /> + <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" /> + <path location="${build.dir}/../classes" /> + <path location="${build.dir}/../../etc" /> + <path location="${hibernate-core.home}\jdbc\hsqldb.jar" /> + <fileset dir="${hibernate-core.lib.dir}"> + <include name="*.jar" /> + </fileset> + </path> + <taskdef name="hibernatetoolx" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" /> + <hibernatetoolx destdir="${build.dir}/bottomup"> + <annotationconfiguration configurationfile="test-hibernate.cfg.xml" /> + <hbm2ddl console="true" export="false" /> + </hibernatetoolx> + </target> + + <target name="testantejb3cfg"> + <path id="annlib"> + <path location="${build.dir}/../../lib/freemarker.jar" /> + + <path location="${build.dir}/../../lib/testlibs/hibernate3.jar" /> + <path location="${build.dir}/../../lib/testlibs/hibernate-annotations.jar" /> + <path location="${build.dir}/../../lib/testlibs/ejb3-persistence.jar" /> + <path location="${build.dir}/../../lib/testlibs/hibernate-entitymanager.jar" /> + <path location="${build.dir}/../../lib/testlibs/jboss-archive-browsing.jar" /> + <path location="${build.dir}/../../lib/testlibs/javaassist.jar" /> + <path location="${build.dir}/../classes" /> + <path location="${hibernate-core.home}\jdbc\hsqldb.jar" /> + <!-- <fileset dir="${hibernate-core.lib.dir}"> + + </fileset>--> + </path> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" /> + + <delete dir="${build.dir}/ejb3" /> + <mkdir dir="${build.dir}/ejb3" /> + + <antcall target="prepareCfg2hbm" /> + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" /> + <hbm2java ejb3="true" jdk5="true" destdir="${build.dir}/ejb3/src" /> + </hibernatetool> + + <mkdir dir="${build.dir}/ejb3/classes" /> + <javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" /> + + <copy file="ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" /> + <copy file="ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" /> + + <hibernatetool destdir="${build.dir}"> + <ejb3configuration /> + <classpath> + <path location="${build.dir}/ejb3/classes" /> + </classpath> + <hbm2ddl export="false" outputfilename="ejb3.sql" /> + </hibernatetool> + + <antcall target="afterCfg2hbm" /> + </target> + + <target name="testantejb3hbm2java"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + + <hibernatetool destdir="${build.dir}/bottomup"> + <configuration propertyfile="../../etc/hibernate.properties"> + <fileset dir="../test/org/hibernate/tool/hbm2x"> + <include name="**/*.hbm.xml" /> + </fileset> + </configuration> + + <hbm2java ejb3="true" /> + </hibernatetool> + + </target> + + <target name="prepareCfg2hbm" description="prepare for cfg2hbm tasks"> + <sql onerror="continue" driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${hibernate-core.home}\jdbc\hsqldb.jar"> + create table VeriSimplyTable ( id bigint not null, name varchar(255), primary key (id) ); + SHUTDOWN; </sql> - <delete dir="${build.dir}/cfg2hbm" failonerror="false"/> - <mkdir dir="${build.dir}/cfg2hbm"/> -</target> + <delete dir="${build.dir}/cfg2hbm" failonerror="false" /> + <mkdir dir="${build.dir}/cfg2hbm" /> + </target> -<target name="afterCfg2hbm" description="prepare for cfg2hbm tasks"> - <sql onerror="continue" - driver="${hibernate.connection.driver_class}" - url="${hibernate.connection.url}" - userid="${hibernate.connection.username}" - password="${hibernate.connection.password}" - classpath="${hibernate-core.lib.dir}/hsqldb-1.7.3.3.jar"> - drop table VeriSimplyTable + <target name="afterCfg2hbm" description="prepare for cfg2hbm tasks"> + <sql onerror="continue" driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${hibernate-core.home}\jdbc\hsqldb.jar"> + drop table VeriSimplyTable; + SHUTDOWN; </sql> - </target> - -<target name="testantcfg2hbm1" depends="prepareCfg2hbm" description="simple CFG2HBM"> -<taskdef name="hibernatetool" - classname="org.hibernate.tool.ant.HibernateToolTask" - classpathref="tasks.classpath"/> + </target> - <hibernatetool> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties"/> - <hbm2hbmxml destdir="${build.dir}/cfg2hbm"/> - </hibernatetool> - - <antcall target="afterCfg2hbm"/> -</target> + <target name="testantcfg2hbm1" depends="prepareCfg2hbm" description="simple CFG2HBM"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> -<target name="testantcfg2hbm2" depends="prepareCfg2hbm" description="valid custom ReverseEngineeringStrategy"> -<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" /> + <hbm2hbmxml destdir="${build.dir}/cfg2hbm" /> + </hibernatetool> - <hibernatetool> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties"/> - - <hbm2hbmxml destdir="${build.dir}/cfg2hbm"/> - </hibernatetool> - - <antcall target="afterCfg2hbm"/> -</target> + <antcall target="afterCfg2hbm" /> + </target> -<target name="testantcfg2hbm3" depends="prepareCfg2hbm" description="invalid ReverseEngineeringStrategy classname"> -<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <target name="testantcfg2hbm2" depends="prepareCfg2hbm" description="valid custom ReverseEngineeringStrategy"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> - <hibernatetool> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties" reversestrategy="invalid.classname" /> - <hbm2hbmxml destdir="${build.dir}/cfg2hbm"/> - </hibernatetool> - - <antcall target="afterCfg2hbm"/> - -</target> + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" /> -<target name="testantcfg2hbm4" depends="prepareCfg2hbm" description="CFG2HBM with packageName"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <hbm2hbmxml destdir="${build.dir}/cfg2hbm" /> + </hibernatetool> - <hibernatetool> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test"/> - <hbm2hbmxml destdir="${build.dir}/cfg2hbm"/> - </hibernatetool> - - <antcall target="afterCfg2hbm"/> -</target> + <antcall target="afterCfg2hbm" /> + </target> -<target name="testantcfg2hbm5" depends="prepareCfg2hbm" description="CFG2HBM with packageName and ReverseEngineeringStrategy"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <target name="testantcfg2hbm3" depends="prepareCfg2hbm" description="invalid ReverseEngineeringStrategy classname"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> - <hibernatetool> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy"/> - <hbm2hbmxml destdir="${build.dir}/cfg2hbm"/> - </hibernatetool> - - <antcall target="afterCfg2hbm"/> -</target> - - <target name="noconinfoexport" description="hbm2ddl without connection info"> - <mkdir dir="${build.dir}/noconinfo"/> + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" reversestrategy="invalid.classname" /> + <hbm2hbmxml destdir="${build.dir}/cfg2hbm" /> + </hibernatetool> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> + <antcall target="afterCfg2hbm" /> - <hibernatetool destdir="${build.dir}/noconinfo"> - <configuration configurationfile="noconnectioninfo-hibernate.cfg.xml"> - <fileset dir="../test" id="id"> - <include name="**/*TopDown.hbm.xml"/> - </fileset> - </configuration> - <hbm2ddl haltonerror="true" export="false" outputfilename="noconinfo.sql"/> - </hibernatetool> - </target> + </target> - <target name="testnoexporters" description="tool without anyexporters - should fail"> - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath"/> - <hibernatetool> - <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy"/> - </hibernatetool> - </target> + <target name="testantcfg2hbm4" depends="prepareCfg2hbm" description="CFG2HBM with packageName"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" /> + <hbm2hbmxml destdir="${build.dir}/cfg2hbm" /> + </hibernatetool> + + <antcall target="afterCfg2hbm" /> + </target> + + <target name="testantcfg2hbm5" depends="prepareCfg2hbm" description="CFG2HBM with packageName and ReverseEngineeringStrategy"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy" /> + <hbm2hbmxml destdir="${build.dir}/cfg2hbm" /> + </hibernatetool> + + <antcall target="afterCfg2hbm" /> + </target> + + <target name="noconinfoexport" description="hbm2ddl without connection info"> + <mkdir dir="${build.dir}/noconinfo" /> + + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + + <hibernatetool destdir="${build.dir}/noconinfo"> + <configuration configurationfile="noconnectioninfo-hibernate.cfg.xml"> + <fileset dir="../test" id="id"> + <include name="**/*TopDown.hbm.xml" /> + </fileset> + </configuration> + <hbm2ddl haltonerror="true" export="false" outputfilename="noconinfo.sql" /> + </hibernatetool> + </target> + + <target name="testnoexporters" description="tool without anyexporters - should fail"> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" /> + <hibernatetool> + <jdbcconfiguration propertyfile="../../etc/hibernate.properties" packageName="org.h3.test" reversestrategy="org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy" /> + </hibernatetool> + </target> </project> |