Hibernate SVN: r19429 - in core/trunk: parent and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-05-08 17:58:15 -0400 (Sat, 08 May 2010)
New Revision: 19429
Modified:
core/trunk/core/src/main/java/org/hibernate/cfg/SettingsFactory.java
core/trunk/parent/pom.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/lock/JPALockTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java
Log:
HHH-5200 - Prepare to use H2 as the default testing datbase
Modified: core/trunk/core/src/main/java/org/hibernate/cfg/SettingsFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cfg/SettingsFactory.java 2010-05-08 21:20:33 UTC (rev 19428)
+++ core/trunk/core/src/main/java/org/hibernate/cfg/SettingsFactory.java 2010-05-08 21:58:15 UTC (rev 19429)
@@ -114,8 +114,18 @@
Connection conn = connections.getConnection();
try {
DatabaseMetaData meta = conn.getMetaData();
- log.info( "RDBMS: " + meta.getDatabaseProductName() + ", version: " + meta.getDatabaseProductVersion() );
- log.info( "JDBC driver: " + meta.getDriverName() + ", version: " + meta.getDriverVersion() );
+ log.info( "Database ->\n" +
+ " name : " + meta.getDatabaseProductName() + '\n' +
+ " version : " + meta.getDatabaseProductVersion() + '\n' +
+ " major : " + meta.getDatabaseMajorVersion() + '\n' +
+ " minor : " + meta.getDatabaseMinorVersion()
+ );
+ log.info( "Driver ->\n" +
+ " name : " + meta.getDriverName() + '\n' +
+ " version : " + meta.getDriverVersion() + '\n' +
+ " major : " + meta.getDriverMajorVersion() + '\n' +
+ " minor : " + meta.getDriverMinorVersion()
+ );
dialect = DialectFactory.buildDialect( props, conn );
jdbcSupport = JdbcSupportLoader.loadJdbcSupport( conn );
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2010-05-08 21:20:33 UTC (rev 19428)
+++ core/trunk/parent/pom.xml 2010-05-08 21:58:15 UTC (rev 19429)
@@ -592,7 +592,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
- <version>1.2.124</version>
+ <version>1.2.134</version>
</dependency>
</dependencies>
<properties>
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java 2010-05-08 21:20:33 UTC (rev 19428)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java 2010-05-08 21:58:15 UTC (rev 19429)
@@ -185,12 +185,14 @@
public void cleanup() {
Session session = openSession();
Transaction txn = session.beginTransaction();
- session.createQuery( "delete Animal where mother is not null" ).executeUpdate();
- List humansWithFriends = session.createQuery( "from Human h where exists(from h.friends)" ).list();
- Iterator itr = humansWithFriends.iterator();
- while ( itr.hasNext() ) {
- session.delete( itr.next() );
- }
+ Human father = (Human) session.createQuery( "from Human where description = 'father'" ).uniqueResult();
+ father.getFriends().clear();
+ session.flush();
+ session.delete( session.createQuery( "from Human where description = 'friend'" ).uniqueResult() );
+ session.delete( session.createQuery( "from Human where description = 'child1'" ).uniqueResult() );
+ session.delete( session.createQuery( "from Human where description = 'child2'" ).uniqueResult() );
+ session.delete( session.createQuery( "from Human where description = 'mother'" ).uniqueResult() );
+ session.delete( father );
session.createQuery( "delete Animal" ).executeUpdate();
txn.commit();
session.close();
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/lock/JPALockTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/lock/JPALockTest.java 2010-05-08 21:20:33 UTC (rev 19428)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/lock/JPALockTest.java 2010-05-08 21:58:15 UTC (rev 19429)
@@ -74,7 +74,7 @@
Long itemId = item.getId();
- // doAfterTransactionCompletion the isolated update
+ // do the isolated update
s1 = getSessions().openSession();
t1 = s1.beginTransaction();
item = (Item) s1.get( Item.class, itemId );
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java 2010-05-08 21:20:33 UTC (rev 19428)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java 2010-05-08 21:58:15 UTC (rev 19429)
@@ -8,6 +8,7 @@
import junit.framework.Test;
import org.hibernate.HibernateException;
+import org.hibernate.id.PostInsertIdentifierGenerator;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
import org.hibernate.classic.Session;
import org.hibernate.dialect.HSQLDialect;
@@ -31,11 +32,16 @@
return new FunctionalTestClassTestSuite( CustomSQLTest.class );
}
+ private boolean isUsingIdentity() {
+ return PostInsertIdentifierGenerator.class.isAssignableFrom( getDialect().getNativeIdentifierGeneratorClass() );
+ }
+
public void testInsert() throws HibernateException, SQLException {
+ if ( isUsingIdentity() ) {
+ reportSkip( "hand sql expecting non-identity id gen", "Custom SQL" );
+ return;
+ }
- if ( getDialect() instanceof HSQLDialect ) return;
- if ( getDialect() instanceof MySQLDialect ) return;
-
Role p = new Role();
p.setName("Patient");
@@ -93,10 +99,11 @@
}
public void testCollectionCUD() throws HibernateException, SQLException {
-
- if ( getDialect() instanceof HSQLDialect ) return;
- if ( getDialect() instanceof MySQLDialect ) return;
-
+ if ( isUsingIdentity() ) {
+ reportSkip( "hand sql expecting non-identity id gen", "Custom SQL" );
+ return;
+ }
+
Role role = new Role();
role.setName("Jim Flanders");
@@ -155,10 +162,11 @@
}
public void testCRUD() throws HibernateException, SQLException {
+ if ( isUsingIdentity() ) {
+ reportSkip( "hand sql expecting non-identity id gen", "Custom SQL" );
+ return;
+ }
- if ( getDialect() instanceof HSQLDialect ) return;
- if ( getDialect() instanceof MySQLDialect ) return;
-
Person p = new Person();
p.setName("Max");
@@ -206,7 +214,5 @@
s.connection().commit();
s.close();
-
-
}
}
14 years, 8 months
Hibernate SVN: r19428 - core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/generatedkeys/seqidentity.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 17:20:33 -0400 (Sat, 08 May 2010)
New Revision: 19428
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/generatedkeys/seqidentity/SequenceIdentityTest.java
Log:
JBPAPP-3913 Oracle 11g R2 RAC - Test SequenceIdentityTest fails because first value of sequence is "2"
Modified: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/generatedkeys/seqidentity/SequenceIdentityTest.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/generatedkeys/seqidentity/SequenceIdentityTest.java 2010-05-08 21:18:02 UTC (rev 19427)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/generatedkeys/seqidentity/SequenceIdentityTest.java 2010-05-08 21:20:33 UTC (rev 19428)
@@ -43,7 +43,7 @@
session.save( e );
// this insert should happen immediately!
- assertEquals( "id not generated through forced insertion", new Long(1), e.getId() );
+ assertNotNull( "id not generated through forced insertion", e.getId() );
session.delete( e );
session.getTransaction().commit();
14 years, 8 months
Hibernate SVN: r19427 - in annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations: query and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 17:18:02 -0400 (Sat, 08 May 2010)
New Revision: 19427
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java
Log:
JBPAPP-2945
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-05-08 14:47:05 UTC (rev 19426)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-05-08 21:18:02 UTC (rev 19427)
@@ -68,7 +68,7 @@
s.close();
}
- @SkipForDialect(jiraKey="HHH-4876",value={PostgreSQLDialect.class})
+
public void testBlob() throws Exception {
Session s;
Transaction tx;
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java 2010-05-08 14:47:05 UTC (rev 19426)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java 2010-05-08 21:18:02 UTC (rev 19427)
@@ -10,6 +10,8 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
+import org.hibernate.dialect.PostgreSQLDialect;
+import org.hibernate.junit.SkipForDialect;
import org.hibernate.stat.Statistics;
import org.hibernate.test.annotations.A320;
import org.hibernate.test.annotations.A320b;
@@ -255,7 +257,7 @@
// s.close();
//
// }
-
+ @SkipForDialect(jiraKey="JBPAPP-2945",value={PostgreSQLDialect.class})
public void testCache() throws Exception {
Session s;
Transaction tx;
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java 2010-05-08 14:47:05 UTC (rev 19426)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java 2010-05-08 21:18:02 UTC (rev 19427)
@@ -6,12 +6,15 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.PostgreSQLDialect;
+import org.hibernate.junit.SkipForDialect;
import org.hibernate.test.annotations.TestCase;
/**
* @author Emmanuel Bernard
*/
public class Ejb3XmlTest extends TestCase {
+ @SkipForDialect(jiraKey="JBPAPP-2945",value={PostgreSQLDialect.class})
public void testEjb3Xml() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
14 years, 8 months
Hibernate SVN: r19426 - entitymanager/branches/v3_4_0_GA_CP.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 10:47:05 -0400 (Sat, 08 May 2010)
New Revision: 19426
Modified:
entitymanager/branches/v3_4_0_GA_CP/pom.xml
Log:
JBPAPP-3379
Modified: entitymanager/branches/v3_4_0_GA_CP/pom.xml
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/pom.xml 2010-05-08 14:46:23 UTC (rev 19425)
+++ entitymanager/branches/v3_4_0_GA_CP/pom.xml 2010-05-08 14:47:05 UTC (rev 19426)
@@ -163,9 +163,6 @@
<additionalClasspathElement>${basedir}/target/test-packages/space par.par</additionalClasspathElement>
<additionalClasspathElement>${basedir}/target/test-packages/war.war</additionalClasspathElement>
</additionalClasspathElements>
- <systemPropertyVariables>
- <hibernate.jdbc.use_streams_for_binary>${hibernate.jdbc.use_streams_for_binary}</hibernate.jdbc.use_streams_for_binary>
- </systemPropertyVariables>
</configuration>
</plugin>
<plugin>
14 years, 8 months
Hibernate SVN: r19425 - annotations/branches/v3_4_0_GA_CP.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 10:46:23 -0400 (Sat, 08 May 2010)
New Revision: 19425
Modified:
annotations/branches/v3_4_0_GA_CP/pom.xml
Log:
JBPAPP-3379
Modified: annotations/branches/v3_4_0_GA_CP/pom.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/pom.xml 2010-05-08 14:43:04 UTC (rev 19424)
+++ annotations/branches/v3_4_0_GA_CP/pom.xml 2010-05-08 14:46:23 UTC (rev 19425)
@@ -128,9 +128,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
-<systemPropertyVariables>
-<hibernate.jdbc.use_streams_for_binary>${hibernate.jdbc.use_streams_for_binary}</hibernate.jdbc.use_streams_for_binary>
-</systemPropertyVariables>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
14 years, 8 months
Hibernate SVN: r19424 - entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 10:43:04 -0400 (Sat, 08 May 2010)
New Revision: 19424
Modified:
entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java
Log:
JBPAPP-4235 HHH-4822 Add @FailureExpected annotation to annotations and entitymananger modules to allow the skipping of tests
Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java 2010-05-08 14:38:53 UTC (rev 19423)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/ejb/test/TestCase.java 2010-05-08 14:43:04 UTC (rev 19424)
@@ -118,8 +118,18 @@
}
protected void closeResources() {
- handleUnclosedResources();
try {
+ cleanUnclosed( this.em );
+ } catch ( Exception ignore ) {
+ }
+ for ( Iterator iter = isolatedEms.iterator(); iter.hasNext(); ) {
+
+ try {
+ cleanUnclosed( ( EntityManager ) iter.next() );
+ } catch ( Exception ignore ) {
+ }
+ }
+ try {
if ( factory != null ) {
factory.close();
factory = null;
14 years, 8 months
Hibernate SVN: r19423 - core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 10:38:53 -0400 (Sat, 08 May 2010)
New Revision: 19423
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/HbmBinder.java
Log:
clean unused import
Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/HbmBinder.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2010-05-08 13:25:52 UTC (rev 19422)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/HbmBinder.java 2010-05-08 14:38:53 UTC (rev 19423)
@@ -25,7 +25,6 @@
package org.hibernate.cfg;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
14 years, 8 months
Hibernate SVN: r19422 - core/branches/Branch_3_3_2_GA_CP/parent.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 09:25:52 -0400 (Sat, 08 May 2010)
New Revision: 19422
Modified:
core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
Log:
JBPAPP-4253 update db driver version
Modified: core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-05-08 12:25:15 UTC (rev 19421)
+++ core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-05-08 13:25:52 UTC (rev 19422)
@@ -506,6 +506,7 @@
<artifactId>postgresql</artifactId>
<version>8.2-510</version>
<scope>test</scope>
+ <classifier>jdbc4</classifier>
</dependency>
</dependencies>
<properties>
@@ -527,6 +528,7 @@
<artifactId>postgresql</artifactId>
<version>8.3-605</version>
<scope>test</scope>
+ <classifier>jdbc4</classifier>
</dependency>
</dependencies>
<properties>
14 years, 8 months
Hibernate SVN: r19421 - annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/join.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-05-08 08:25:15 -0400 (Sat, 08 May 2010)
New Revision: 19421
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/join/JoinTest.java
Log:
replace Expression.eq with Restrictions.eq because of EXpression is depreated
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/join/JoinTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/join/JoinTest.java 2010-05-08 12:05:48 UTC (rev 19420)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/join/JoinTest.java 2010-05-08 12:25:15 UTC (rev 19421)
@@ -9,7 +9,7 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.criterion.Expression;
+import org.hibernate.criterion.Restrictions;
import org.hibernate.mapping.Join;
import org.hibernate.test.annotations.TestCase;
@@ -107,7 +107,7 @@
s = openSession();
tx = s.beginTransaction();
Criteria crit = s.createCriteria( Life.class );
- crit.createCriteria( "owner" ).add( Expression.eq( "name", "kitty" ) );
+ crit.createCriteria( "owner" ).add( Restrictions.eq( "name", "kitty" ) );
life = (Life) crit.uniqueResult();
assertEquals( "Long long description", life.fullDescription );
s.delete( life.owner );
14 years, 8 months