Author: gbadner
Date: 2009-03-31 18:26:36 -0400 (Tue, 31 Mar 2009)
New Revision: 16247
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
Log:
JBPAPP-1852 ANN-778 : Test hangs if an exception is thrown, due to unclosed transaction
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java 2009-03-31
22:07:07 UTC (rev 16246)
+++
annotations/branches/v3_4_0_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java 2009-03-31
22:26:36 UTC (rev 16247)
@@ -28,17 +28,12 @@
public void setUp() throws Exception {
super.setUp();
- session = getSessions().openSession();
+ session = openSession();
session.getTransaction().begin();
edition = new Edition<String>();
edition.name = "Second";
}
- public void tearDown() throws Exception {
- session.close();
- super.tearDown();
- }
-
public void testWorksWithGenericEmbedded() {
Book b = new Book();
b.edition = edition;
@@ -48,6 +43,7 @@
assertEquals( "Second", retrieved.edition.name );
clean( Book.class, b.id );
+ session.close();
}
public void testWorksWithGenericCollectionOfElements() {
@@ -59,6 +55,7 @@
assertEquals( "Second", retrieved.editions.iterator().next().name );
clean( PopularBook.class, b.id );
+ session.close();
}
protected Class[] getMappings() {
Show replies by date