Hibernate SVN: r20862 - in tools/trunk: lib/testlibs and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-11-11 16:33:41 -0500 (Thu, 11 Nov 2010)
New Revision: 20862
Added:
tools/trunk/lib/testlibs/version.properties
Modified:
tools/trunk/pom.xml
tools/trunk/src/test/org/hibernate/tool/ant/AntHibernateToolTest.java
tools/trunk/src/test/org/hibernate/tool/ant/BuildFileTestCase.java
tools/trunk/src/test/org/hibernate/tool/ant/CoreTaskTest.java
tools/trunk/src/test/org/hibernate/tool/ant/JavaFormatterTest.java
tools/trunk/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java
tools/trunk/src/testsupport/anttest-build.xml
tools/trunk/src/testsupport/coretest-build.xml
Log:
JBIDE-7532 Fix hibernate tools junit tests
Added: tools/trunk/lib/testlibs/version.properties
===================================================================
--- tools/trunk/lib/testlibs/version.properties (rev 0)
+++ tools/trunk/lib/testlibs/version.properties 2010-11-11 21:33:41 UTC (rev 20862)
@@ -0,0 +1,185 @@
+hibernate.lib=hibernate3.jar
+hibernate.ignorecheck=true
+
+ant.lib=ant-1.6.5.jar
+ant.version=1.6.5
+ant.name=Ant core
+ant.when=buildtime
+
+ant-antlr.lib=ant-antlr-1.6.5.jar
+ant-antlr.version=1.6.5
+ant-antlr.name=Ant antlr support
+ant-antlr.when=buildtime
+
+ant-junit.lib=ant-junit-1.6.5.jar
+ant-junit.version=1.6.5
+ant-junit.name=Ant junit support
+ant-junit.when=buildtime
+
+ant-launcher.lib=ant-launcher-1.6.5.jar
+ant-launcher.version=1.6.5
+ant-launcher.name=Ant launcher
+ant-launcher.when=buildtime
+
+ant-swing.lib=ant-swing-1.6.5.jar
+ant-swing.version=1.6.5
+ant-swing.name=Ant swing support
+ant-swing.when=buildtime
+
+junit.lib=junit-3.8.1.jar
+junit.version=3.8.1
+junit.name=JUnit test framework
+junit.when=buildtime
+
+checkstyle.lib=checkstyle-all.jar
+checkstyle.name=Checkstyle
+checkstyle.when=buildtime
+
+cleanimports.lib=cleanimports.jar
+cleanimports.name=cleanimports
+cleanimports.when=buildtime
+hibernate.version=3.0
+hibernate.name=Hibernate core
+hibernate.when=runtime, required
+
+versioncheck.lib=versioncheck.jar
+versioncheck.version=1.0
+versioncheck.name=version checker
+versioncheck.when=buildtime
+
+syndiag.lib=syndiag2.jar
+syndiag.version=2.0
+syndiag.name=antlr to bnf image generator
+syndiag.when=buildtime
+
+javassist.lib=javassist.jar
+javassist.version=3.4
+javassist.name=Javassist bytecode generator
+javassist.when=runtime, required if using 'javassist' bytecode provider
+
+cglib.lib=cglib-2.1.3.jar
+cglib.version=2.1.3
+cglib.name=CGLIB bytecode generator
+cglib.when=runtime, required if using 'cglib' bytecode provider
+
+asm.lib=asm.jar
+asm.name=ASM bytecode library
+asm.when=runtime, required if using 'cglib' bytecode provider
+
+asm-attrs.lib=asm-attrs.jar
+asm-attrs.name=ASM bytecode library
+asm-attrs.when=runtime, required if using 'cglib' bytecode provider
+
+commons-collections.lib=commons-collections-2.1.1.jar
+commons-collections.version=2.1.1
+commons-collections.name=Commons Collections
+commons-collections.when=runtime, required
+
+commons-logging.lib=commons-logging-1.0.4.jar
+commons-logging.version=1.0.4
+commons-logging.name=Commons Logging
+commons-logging.when=runtime, required
+
+antlr.lib=antlr-2.7.6.jar
+antlr.version=2.7.6
+antlr.name=ANother Tool for Language Recognition
+antlr.when=runtime, required
+
+## xml/xslt handling
+
+dom4j.lib=dom4j-1.6.1.jar
+dom4j.version=1.6.1
+dom4j.name=XML configuration & mapping parser
+dom4j.when=runtime, required
+
+jaxen.lib=jaxen-1.1-beta-7.jar
+jaxen.version=1.1-beta-7
+jaxen.name=Jaxen - universal java xpath engine
+jaxen.when=runtime, required if you want to deserialize a Configuration to improve startup performance
+
+xerces.lib=xerces-2.6.2.jar
+xerces.version=2.6.2
+xerces.name=SAX parser
+xerces.when=runtime, required for JDK < 1.4
+
+xml-apis.lib=xml-apis.jar
+xml-apis.name=Standard JAXP API
+xml-apis.when=runtime, some SAX parser is required
+
+## j2ee related
+
+jta.lib=jta.jar
+jta.name=Standard JTA API
+jta.when=runtime, required for standalone operation (outside application server)
+
+jaas.lib=jaas.jar
+jaas.name=Standard JAAS API
+jaas.when=runtime, optional (required by JCA)
+
+log4j.lib=log4j-1.2.11.jar
+log4j.version=1.2.11
+log4j.name=Log4j Library
+log4j.when=runtime, optional
+
+## Treecache
+
+jboss-cache.lib=jboss-cache.jar
+jboss-cache.version=1.2.2 alpha
+jboss-cache.name=TreeCache clustered cache
+jboss-cache.when=runtime, optional
+
+concurrent.lib=concurrent-1.3.2.jar
+concurrent.version=1.3.2
+concurrent.when=runtime, optional (required by TreeCache)
+
+jboss-common.lib=jboss-common.jar
+jboss-common.when=runtime, optional (required by TreeCache)
+
+jboss-jmx.lib=jboss-jmx.jar
+jboss-jmx.when=runtime, optional (required by TreeCache)
+
+jboss-system.lib=jboss-system.jar
+jboss-system.when=runtime, optional (required by TreeCache)
+
+## Replication
+
+jgroups.lib=jgroups-2.2.8.jar
+jgroups.version=2.2.8
+jgroups.name=JGroups multicast library
+jgroups.when=runtime, optional (required by replicated caches)
+
+## cache providers
+
+ehcache.lib=ehcache-1.2.3.jar
+ehcache.version=1.2.3
+ehcache.name=EHCache cache
+ehcache.when=runtime, optional (required if no other cache provider is set)
+
+oscache.lib=oscache-2.1.jar
+oscache.version=2.1
+oscache.name=OpenSymphony OSCache
+oscache.when=runtime, optional
+
+swarmcache.lib=swarmcache-1.0rc2.jar
+swarmcache.version=1.0rc2
+swarmcache.name=runtime, optional
+swarmcache.when=runtime, optional
+
+## connection pool
+
+c3p0.lib=c3p0-0.9.1.jar
+c3p0.version=0.9.1
+c3p0.name=C3P0 JDBC connection pool
+c3p0.when=runtime, optional (needed if using c3p0 as the connection pooling library)
+
+proxool.lib=proxool-0.8.3.jar
+proxool.version=0.8.3
+proxool.name=Proxool JDBC connection pool
+proxool.when=runtime, optional (needed if using proxool as the connection pooling library)
+
+
+jacc.lib=jacc-1_0-fr.jar
+jacc.version=1.0-fr
+jacc.name=JACC Library
+jacc.when=runtime, optional
+
Modified: tools/trunk/pom.xml
===================================================================
--- tools/trunk/pom.xml 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/pom.xml 2010-11-11 21:33:41 UTC (rev 20862)
@@ -267,6 +267,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.5</version>
<executions>
<execution>
<id>add-test-source</id>
Modified: tools/trunk/src/test/org/hibernate/tool/ant/AntHibernateToolTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/ant/AntHibernateToolTest.java 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/test/org/hibernate/tool/ant/AntHibernateToolTest.java 2010-11-11 21:33:41 UTC (rev 20862)
@@ -10,9 +10,6 @@
import junit.framework.TestSuite;
import org.apache.tools.ant.BuildException;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.Session;
import org.hibernate.tool.test.TestHelper;
/**
@@ -28,16 +25,30 @@
}
protected void tearDown() throws Exception {
- executeTarget("cleanup");
- System.out.println(getLog());
+ cleanup();
super.tearDown();
}
+
protected void setUp() throws Exception {
super.setUp();
configureProject("src/testsupport/anttest-build.xml");
- executeTarget( "cleanup" );
}
+ private void cleanup(){
+ executeTarget("afterCfg2hbm");
+ boolean removed = false;
+ do{
+ try {
+ executeTarget("removeDirs");
+ removed = true;
+ } catch (BuildException be){
+ //Unable to delete file ...\testdb\hsqldb.log
+ //if isn't removed calls
+ //User SA not fount for all the next tests.
+ }
+ } while (!removed);
+ }
+
public void testHbm2DDLLogic() {
cleanupOutputDir();
File baseDir = new File(project.getProperty("build.dir"), "topdown");
@@ -54,6 +65,7 @@
// allow to test creation of script file + delimiter
// + non execution (test will fail if executed because of crappy delimiter)
executeTarget("testScriptCreation");
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertTrue(onlyCreate.exists());
assertTrue(onlyDrop.exists());
@@ -78,7 +90,6 @@
onlyDrop.delete();
dropAndCreate.delete();
update.delete();
-
}
public void testHbm2DDLUpdateExecution() {
@@ -94,6 +105,7 @@
executeTarget("testantcfgUpdateExecuted");
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertTrue(update1.exists());
assertTrue(update2.exists());
@@ -120,6 +132,7 @@
executeTarget("testantcfgExportExecuted");
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertTrue(export.exists());
assertTrue(update.exists());
@@ -135,10 +148,12 @@
public void testJDBCConfiguration() {
executeTarget("testantjdbccfg");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testAnnotationConfigurationFailureExpected() {
executeTarget("testantannotationcfg");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testEJB3ConfigurationFailureExpected() {
@@ -150,20 +165,20 @@
assertEquals(null, TestHelper.findFirstString("drop", ejb3));
assertTrue(getLog().indexOf("<ejb3configuration> is deprecated")>0);
-
}
public void testJPABogusPUnit() {
try {
- executeTarget("jpa-bogusunit");
+ executeTarget("jpa-boguspunit");
fail("Bogus unit accepted");
} catch(BuildException be) {
- // should happen
+ assertTrue(getLog(), getLog().contains("Persistence unit not found: 'shouldnotbethere'"));
}
}
public void testJPAPUnit() {
- executeTarget("jpa-punit");
+ executeTarget("jpa-punit");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testJPAPropertyOveridesPUnit() {
@@ -178,18 +193,22 @@
public void testHbm2JavaConfiguration() {
executeTarget("testanthbm2java");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testHbm2JavaEJB3Configuration() {
executeTarget("testantejb3hbm2java");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testCfg2HbmNoError() {
executeTarget("testantcfg2hbm1");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testCfg2HbmWithCustomReverseNamingStrategy() {
executeTarget("testantcfg2hbm2");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testCfg2HbmWithInvalidReverseNamingStrategy() {
@@ -200,23 +219,28 @@
public void testCfg2HbmWithPackageName() {
executeTarget("testantcfg2hbm4");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testCfg2HbmWithPackageNameAndReverseNamingStrategy() {
executeTarget("testantcfg2hbm5");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testJDBCConfigWithRevEngXml() {
executeTarget("testantjdbccfgoverrides");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testProperties() {
- executeTarget("testproperties");
+ executeTarget("testproperties");
+ assertTrue(getLog(), checkLogWithoutExceptions());
}
public void testGenericExport() {
executeTarget("testgeneric");
+ assertTrue(getLog(), checkLogWithoutExceptions());
property = project.getProperty("build.dir");
assertTrue(new File(property, "generic").exists());
@@ -259,6 +283,7 @@
public void testQuery() {
executeTarget("testquery");
+ assertTrue(getLog(), checkLogWithoutExceptions());
File baseDir = new File(project.getProperty("build.dir"), "querytest");
@@ -268,6 +293,7 @@
public void testHbmLint() {
executeTarget("testhbmlint");
+ assertTrue(getLog(), checkLogWithoutExceptions());
File baseDir = new File(project.getProperty("build.dir"), "linttest");
@@ -283,6 +309,7 @@
}
}
+
public static Test suite() {
return new TestSuite(AntHibernateToolTest.class);
}
Modified: tools/trunk/src/test/org/hibernate/tool/ant/BuildFileTestCase.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/ant/BuildFileTestCase.java 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/test/org/hibernate/tool/ant/BuildFileTestCase.java 2010-11-11 21:33:41 UTC (rev 20862)
@@ -106,6 +106,13 @@
protected String getLog() {
return logBuffer.toString();
}
+
+ /**
+ * Checks the log for Exceptions
+ */
+ protected boolean checkLogWithoutExceptions(){
+ return !(getLog().contains("Exception"));
+ }
/**
* Assert that the given message has been logged with a priority
Modified: tools/trunk/src/test/org/hibernate/tool/ant/CoreTaskTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/ant/CoreTaskTest.java 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/test/org/hibernate/tool/ant/CoreTaskTest.java 2010-11-11 21:33:41 UTC (rev 20862)
@@ -17,20 +17,18 @@
super(name);
}
-
protected void tearDown() throws Exception {
- System.out.println(getLog() );
-// super.tearDown();
+ executeTarget("cleanup");
+ super.tearDown();
}
-
-
protected void setUp() throws Exception {
configureProject("src/testsupport/coretest-build.xml");
}
public void testSchemaUpdateWarning() {
executeTarget("test-schemaupdatewarning");
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertLogContaining( "Hibernate Core SchemaUpdate" );
assertLogContaining( "tools.hibernate.org" );
}
@@ -38,6 +36,7 @@
/* TODO: this test is suddenly not able to get the log output from ant causing problems.
* public void testSchemaExportWarning() {
executeTarget("test-schemaexportwarning");
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertLogContaining( "Hibernate Core SchemaUpdate" );
assertLogContaining( "tools.hibernate.org" );
}*/
Modified: tools/trunk/src/test/org/hibernate/tool/ant/JavaFormatterTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/ant/JavaFormatterTest.java 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/test/org/hibernate/tool/ant/JavaFormatterTest.java 2010-11-11 21:33:41 UTC (rev 20862)
@@ -23,21 +23,21 @@
public JavaFormatterTest(String name) {
super(name);
}
+
protected void tearDown() throws Exception {
executeTarget( "cleanup" );
- System.out.println(getLog());
super.tearDown();
}
protected void setUp() throws Exception {
super.setUp();
configureProject("src/testsupport/javaformattest-build.xml");
- executeTarget( "cleanup" );
}
public void testJava() {
executeTarget("prepare");
+ assertTrue(getLog(), checkLogWithoutExceptions());
File file = new File(project.getProperty( "build.dir" ), "formatting/SimpleOne.java");
assertFileAndExists( file );
@@ -55,6 +55,7 @@
public void testJavaJdk5() {
executeTarget("prepare");
+ assertTrue(getLog(), checkLogWithoutExceptions());
File file = new File(project.getProperty( "build.dir" ), "formatting/Simple5One.java5");
assertFileAndExists( file );
@@ -68,8 +69,8 @@
waitASec();
executeTarget("prepare");
+ assertTrue(getLog(), checkLogWithoutExceptions());
-
formatter = new JavaFormatter(null);
assertTrue("formatting should pass when using default settings", formatter.formatFile( file ));
@@ -89,21 +90,21 @@
public void testAntxDestDir() {
executeTarget("prepare");
+ assertTrue(getLog(), checkLogWithoutExceptions());
File file = new File(project.getProperty( "build.dir" ), "formatting/SimpleOne.java");
assertFileAndExists( file );
long before = file.lastModified();
waitASec();
executeTarget("fileset");
- System.out.println(getLog());
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertTrue( before!=file.lastModified() );
-
-
}
public void testConfig() {
executeTarget("prepare");
+ assertTrue(getLog(), checkLogWithoutExceptions());
File jdk5file = new File(project.getProperty( "build.dir" ), "formatting/Simple5One.java5");
File jdkfile = new File(project.getProperty( "build.dir" ), "formatting/SimpleOne.java");
@@ -112,12 +113,13 @@
long before = jdkfile.lastModified();
waitASec();
executeTarget("configtest");
- System.out.println(getLog());
+ assertTrue(getLog(), checkLogWithoutExceptions());
+
assertEquals("jdk5 should fail since config is not specifying jdk5",jdk5before, jdk5file.lastModified() );
assertTrue(before<jdkfile.lastModified());
executeTarget("noconfigtest");
- System.out.println(getLog());
+ assertTrue(getLog(), checkLogWithoutExceptions());
assertTrue(jdk5before<jdk5file.lastModified() );
assertTrue(before<jdk5file.lastModified());
Modified: tools/trunk/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/test/org/hibernate/tool/hbm2x/GenericExporterTest.java 2010-11-11 21:33:41 UTC (rev 20862)
@@ -132,7 +132,8 @@
ge.start();
fail();
} catch(Exception e) {
- e.printStackTrace();
+ //e.printStackTrace();
+ //expected
}
}
Modified: tools/trunk/src/testsupport/anttest-build.xml
===================================================================
--- tools/trunk/src/testsupport/anttest-build.xml 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/testsupport/anttest-build.xml 2010-11-11 21:33:41 UTC (rev 20862)
@@ -3,8 +3,9 @@
<property name="target.dir" location="../../target"/>
<property name="test-classes" location="${target.dir}/test-classes"/>
<property file="${test-classes}/hibernate.properties" />
- <property name="jdbc.driver" location="./lib/jdbc/hsqldb.jar"/>
-
+ <property name="lib.dir" location="./lib"/>
+ <property name="testlibs.dir" location="${lib.dir}/testlibs"/>
+ <property name="jdbc.lib" location="${lib.dir}/jdbc/hsqldb.jar"/>
<path id="tasks.classpath">
<pathelement path="${test-classes}" />
@@ -15,13 +16,29 @@
</fileset>
<pathelement path="./lib/freemarker.jar" />
- <pathelement path="${jdbc.driver}" />
+ <pathelement path="${jdbc.lib}" />
</path>
+
+ <path id="annlib">
+ <path location="${lib.dir}/freemarker.jar" />
+ <path location="${testlibs.dir}/hibernate3.jar" />
+ <path location="${testlibs.dir}/hibernate-jpa-2.0-api-1.0.0.Final.jar" />
+ <path location="${testlibs.dir}/jboss-archive-browsing.jar" />
+ <path location="${testlibs.dir}/javaassist.jar" />
+ <path location="${test-classes}" />
+ <path location="${target.dir}/classes" />
+ <path location="./etc" />
+ <path location="${jdbc.lib}" />
+ </path>
<target name="cleanup" description="task used for ensuring cleanup to be done even in the case of test failure" depends="afterCfg2hbm">
+ <antcall target="removeDirs" />
+ </target>
+
+ <target name="removeDirs" description="Removed directories">
<delete dir="${build.dir}"/>
- <delete dir="../../testdb" failonerror="false"/>
+ <delete dir="../../testdb" failonerror="true"/>
</target>
<target name="testScriptCreation">
@@ -208,18 +225,6 @@
</target>
<target name="testantannotationcfg">
- <path id="annlib">
- <path location="./lib/testlibs/hibernate3.jar" />
- <path location="./lib/testlibs/hibernate-annotations.jar" />
- <path location="./lib/testlibs/ejb3-persistence.jar" />
- <path location="${test-classes}" />
- <path location="${target.dir}/classes" />
- <path location="./etc" />
- <path location="${jdbc.driver}" />
- <!-- <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-classes}/test-hibernate.cfg.xml" />
@@ -228,21 +233,6 @@
</target>
<target name="testantejb3cfg">
- <path id="annlib">
- <path location="./lib/freemarker.jar" />
- <path location="./lib/testlibs/hibernate3.jar" />
- <path location="./lib/testlibs/hibernate-annotations.jar" />
- <path location="./lib/testlibs/ejb3-persistence.jar" />
- <path location="./lib/testlibs/hibernate-entitymanager.jar" />
- <path location="./lib/testlibs/jboss-archive-browsing.jar" />
- <path location="./lib/testlibs/javaassist.jar" />
- <path location="${test-classes}" />
- <path location="./target/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" />
@@ -255,7 +245,7 @@
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
- <javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
+ <javac fork="true" classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
<copy file="${test-classes}/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
<copy file="${test-classes}/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
@@ -272,22 +262,10 @@
</target>
<target name="jpa-boguspunit">
- <property file="${hibernate-core.lib.dir}/version.properties" prefix="h3"/>
-
- <path id="annlib">
- <path location="./lib/freemarker.jar" />
- <path location="./lib/testlibs/hibernate3.jar" />
- <path location="./lib/testlibs/hibernate-annotations.jar" />
- <path location="./lib/testlibs/ejb3-persistence.jar" />
- <path location="./lib/testlibs/hibernate-entitymanager.jar" />
- <path location="./lib/testlibs/jboss-archive-browsing.jar" />
- <path location="./lib/testlibs/javaassist.jar" />
- <path location="${test-classes}" />
- <path location="./target/classes" />
- <path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
- </path>
-<!-- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" /> -->
+ <property file="${testlibs.dir}/version.properties" prefix="h3"/>
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" />
+
<delete dir="${build.dir}/ejb3" />
<mkdir dir="${build.dir}/ejb3" />
@@ -298,7 +276,7 @@
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
- <javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
+ <javac fork="true" classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
<copy file="${test-classes}/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
<copy file="${test-classes}/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
@@ -315,39 +293,7 @@
</target>
<target name="jpa-punit">
- <property file="${hibernate-core.lib.dir}/version.properties" prefix="h3"/>
- <property name="testlibs" location="./lib/testlibs"/>
- <path id="annlib">
- <path location="${test-classes}" />
- <path location="./target/classes" />
- <path location="${testlibs}/hibernate3.jar"/>
- <path location="${testlibs}/${h3.commons-logging.lib}"/>
- <path location="${testlibs}/${h3.dom4j.lib}"/>
- <path location="${testlibs}/${h3.cglib.lib}"/>
- <path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
- <path location="${testlibs}/${h3.ehcache.lib}"/>
- <path location="${testlibs}/${h3.commons-collections.lib}"/>
- <path location="${build.dir}/./lib/freemarker.jar" />
- <path location="${testlibs}/ejb3-persistence.jar" />
- <path location="${testlibs}/hibernate-entitymanager.jar" />
- <path location="${testlibs}/jboss-archive-browsing.jar" />
- <path location="${testlibs}/hibernate-annotations.jar" />
- <path location="${testlibs}/javassist.jar" />
- <!--
-
-
-
- <path location="./lib/testlibs/hibernate-annotations.jar" />
- <path location="./lib/testlibs/ejb3-persistence.jar" />
- <path location="./lib/testlibs/hibernate-entitymanager.jar" />
- <path location="./lib/testlibs/jboss-archive-browsing.jar" />
- <path location="./lib/testlibs/javaassist.jar" />
-
- <path location="${hibernate-core.home}\jdbc\hsqldb.jar" /> -->
- <!-- <fileset dir="${hibernate-core.lib.dir}">
-
- </fileset>-->
- </path>
+ <property file="${testlibs.dir}/version.properties" prefix="h3"/>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" />
<delete dir="${build.dir}/ejb3" />
@@ -360,7 +306,7 @@
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
- <javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
+ <javac fork="true" classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
<copy file="${test-classes}/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
<copy file="${test-classes}/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
@@ -373,22 +319,11 @@
<hbm2ddl export="false" outputfilename="ejb3.sql" />
</hibernatetool>
- <antcall target="afterCfg2hbm" />
+
</target>
<target name="jpa-overrides">
- <path id="annlib">
- <path location="./lib/freemarker.jar" />
- <path location="./lib/testlibs/hibernate3.jar" />
- <path location="./lib/testlibs/hibernate-annotations.jar" />
- <path location="./lib/testlibs/ejb3-persistence.jar" />
- <path location="./lib/testlibs/hibernate-entitymanager.jar" />
- <path location="./lib/testlibs/jboss-archive-browsing.jar" />
- <path location="./lib/testlibs/javaassist.jar" />
- <path location="${test-classes}" />
- <path location="./target/classes" />
- <path location="${hibernate-core.home}\jdbc\hsqldb.jar" />
- </path>
+
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="annlib" />
@@ -402,7 +337,7 @@
</hibernatetool>
<mkdir dir="${build.dir}/ejb3/classes" />
- <javac classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
+ <javac fork="true" classpathref="annlib" srcdir="${build.dir}/ejb3/src" destdir="${build.dir}/ejb3/classes" />
<copy file="${test-classes}/ejb3test-persistence.xml" tofile="${build.dir}/ejb3/classes/META-INF/persistence.xml" />
<copy file="${test-classes}/ejb3test-hibernate.cfg.xml" tofile="${build.dir}/ejb3/classes/ejb3test-hibernate.cfg.xml" />
@@ -414,8 +349,6 @@
</classpath>
<hbm2ddl export="false" outputfilename="ejb3.sql" />
</hibernatetool>
-
- <antcall target="afterCfg2hbm" />
</target>
<target name="testantejb3hbm2java">
@@ -434,10 +367,10 @@
</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">
+ <sql onerror="continue" driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${jdbc.lib}">
create table VeriSimplyTable ( id bigint not null, name varchar(255), primary key (id) );
- insert table VeriSimplyTable ( 1, "A Row");
- insert table VeriSimplyTable ( 2, "Another Row");
+ insert into VeriSimplyTable values ( 1, 'A Row');
+ insert into VeriSimplyTable values( 2, 'Another Row');
</sql>
<delete dir="${build.dir}/cfg2hbm" failonerror="false" />
@@ -445,14 +378,14 @@
</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.home}\jdbc\hsqldb.jar">
+ <sql onerror="continue" driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${jdbc.lib}">
delete from VeriSimplyTable where id > 0;
drop table VeriSimplyTable;
- drop table column;
+ drop table top_down;
</sql>
</target>
-
+
<target name="testantcfg2hbm1" depends="prepareCfg2hbm" description="simple CFG2HBM">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="tasks.classpath" />
@@ -460,8 +393,6 @@
<jdbcconfiguration propertyfile="${test-classes}/hibernate.properties" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
-
- <antcall target="afterCfg2hbm" />
</target>
<target name="testantcfg2hbm2" depends="prepareCfg2hbm" description="valid custom ReverseEngineeringStrategy">
@@ -472,8 +403,6 @@
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
-
- <antcall target="afterCfg2hbm" />
</target>
<target name="testantcfg2hbm3" depends="prepareCfg2hbm" description="invalid ReverseEngineeringStrategy classname">
@@ -483,9 +412,6 @@
<jdbcconfiguration propertyfile="${test-classes}/hibernate.properties" reversestrategy="invalid.classname" />
<hbm2hbmxml destdir="${build.dir}/cfg2hbm" />
</hibernatetool>
-
- <antcall target="afterCfg2hbm" />
-
</target>
<target name="testantcfg2hbm4" depends="prepareCfg2hbm" description="CFG2HBM with packageName">
@@ -495,8 +421,6 @@
<jdbcconfiguration propertyfile="${test-classes}/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">
@@ -506,8 +430,6 @@
<jdbcconfiguration propertyfile="${test-classes}/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">
@@ -542,9 +464,7 @@
<hql>from java.io.Serializable</hql>
</query>
<query destfile="queryresult.txt">from java.io.Serializable</query>
- </hibernatetool>
-
- <antcall target="afterCfg2hbm" />
+ </hibernatetool>
</target>
<target name="testhbmlint" depends="prepareCfg2hbm" description="test the query tasks">
@@ -557,9 +477,7 @@
</fileset>
</configuration>
<hbmlint/>
- </hibernatetool>
-
- <antcall target="afterCfg2hbm" />
+ </hibernatetool>
</target>
<target name="noconfig-shoulderror">
Modified: tools/trunk/src/testsupport/coretest-build.xml
===================================================================
--- tools/trunk/src/testsupport/coretest-build.xml 2010-11-08 10:16:04 UTC (rev 20861)
+++ tools/trunk/src/testsupport/coretest-build.xml 2010-11-11 21:33:41 UTC (rev 20862)
@@ -2,19 +2,23 @@
<property name="build.dir" location="../../target/anttest" />
<property name="core.jar" location="${build.dir}/./lib/testlibs/hibernate3.jar" />
<property name="core.libs" location="${build.dir}/./lib/testlibs" />
- <property name="jdbc.driver" location="./lib/jdbc/hsqldb.jar"/>
+ <property name="jdbc.lib" location="./lib/jdbc/hsqldb.jar"/>
<mkdir dir="${build.dir}" />
-
- <property file="./target/test-classes/hibernate.properties" />
+ <property file="../../target/test-classes/hibernate.properties" />
<path id="tasks.classpath">
- <pathelement location="${hibernate-core.jar}" />
- <pathelement path="${jdbc.driver}" />
+ <pathelement location="${core.jar}" />
+ <pathelement path="${jdbc.lib}" />
</path>
+ <target name="cleanup" description="remove topdown table">
+ <sql onerror="continue" driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}"
+ userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${jdbc.lib}">
+ drop table topdown;
+ </sql>
+ </target>
-
<target name="test-schemaexportwarning">
<taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="tasks.classpath" />
@@ -28,7 +32,7 @@
<target name="test-schemaupdatewarning">
<taskdef name="schemaupdate" classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask" classpathref="tasks.classpath"/>
- <schemaupdate quiet="false" text="false" outputfile="notused.txt" >
+ <schemaupdate quiet="false" text="false" outputfile="${build.dir}/notused.txt" >
<fileset dir="../test" id="id">
<include name="**/*TopDown.hbm.xml" />
</fileset>