[hibernate-commits] Hibernate SVN: r16373 - in entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test: emops and 3 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Apr 21 07:47:15 EDT 2009


Author: jcosta at redhat.com
Date: 2009-04-21 07:47:14 -0400 (Tue, 21 Apr 2009)
New Revision: 16373

Modified:
   entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java
   entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/emops/FlushTest.java
   entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java
   entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/lock/LockTest.java
   entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java
Log:
EJB-407 - Fixed tests which weren't closing the EM after finishing their work. For branch v3_4_0_GA_CP

Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java	2009-04-21 11:29:01 UTC (rev 16372)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java	2009-04-21 11:47:14 UTC (rev 16373)
@@ -116,6 +116,7 @@
 		em.flush();
 		assertNotNull( rc.getCreationDate() );
 		em.getTransaction().rollback();
+		em.close();
 	}
 
 	public void testCallBackListenersHierarchy() throws Exception {

Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/emops/FlushTest.java
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/emops/FlushTest.java	2009-04-21 11:29:01 UTC (rev 16372)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/emops/FlushTest.java	2009-04-21 11:47:14 UTC (rev 16373)
@@ -66,7 +66,10 @@
 		for (Decorate value : founds) {
 			assertTrue( names.contains( value.getPet().getName() ) );
 		}
+		manager.getTransaction().rollback();
 		
+		manager.close();
+		
 	}
 
 	public Dog createDog(String name, double weight, int bones, EntityManager manager) {

Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java	2009-04-21 11:29:01 UTC (rev 16372)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java	2009-04-21 11:47:14 UTC (rev 16373)
@@ -100,6 +100,7 @@
 		catch( PersistenceException e ) {
 			Throwable t = e.getCause();
 			assertTrue("Should be a constraint violation", t instanceof ConstraintViolationException);
+			em.getTransaction().rollback();
 		}
 		finally {
 			em.close();

Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/lock/LockTest.java
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/lock/LockTest.java	2009-04-21 11:29:01 UTC (rev 16372)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/lock/LockTest.java	2009-04-21 11:47:14 UTC (rev 16373)
@@ -30,6 +30,8 @@
 		assertEquals( "surname", lock.getName() );
 		em.remove( lock );
 		em.getTransaction().commit();
+		
+		em.close();
 	}
 
 	public void testLockWrite() throws Exception {

Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java	2009-04-21 11:29:01 UTC (rev 16372)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java	2009-04-21 11:47:14 UTC (rev 16373)
@@ -42,6 +42,7 @@
 		em.getTransaction().begin();
 		em.remove( em.find( Book.class, book.id ) );
 		em.getTransaction().commit();
+		em.close();
 	}
 
 //	public void testTransactionalOperationsWhenTransactional() throws Exception {




More information about the hibernate-commits mailing list