mirror of
https://github.com/apache/openjpa.git
synced 2025-02-21 09:35:40 +00:00
make sure tests close EMs and EMFs
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1022292 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ede1ebe30f
commit
dbbb6bf815
@ -167,9 +167,4 @@ public class TestBiDirectionalJoinTable extends SQLListenerTestCase {
|
||||
assertEquals(1+2*ADDRESS_COUNT, sql.size());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void tearDown() {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -57,8 +57,9 @@ public class TestOneSidedParentChildWithImplicitForeignKey extends
|
||||
private static long CHILD_ID_COUNTER = System.currentTimeMillis();
|
||||
private static int CHILD_COUNT = 3;
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
setUp(DROP_TABLES, ParentWithAppIdentity.class,
|
||||
super.setUp(DROP_TABLES, ParentWithAppIdentity.class,
|
||||
ParentWithSequenceIdentity.class, ParentWithAutoIdentity.class,
|
||||
Child.class);
|
||||
em = emf.createEntityManager();
|
||||
@ -150,8 +151,10 @@ public class TestOneSidedParentChildWithImplicitForeignKey extends
|
||||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void tearDown() {
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
closeEM(em);
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public IParent newParent(int parentType) {
|
||||
|
@ -95,6 +95,8 @@ public class TestQualifiedPath extends SQLListenerTestCase {
|
||||
q = em.createQuery(query);
|
||||
rs = q.getResultList();
|
||||
assertEquals(1, rs.size());
|
||||
em.close();
|
||||
em = null;
|
||||
}
|
||||
|
||||
private void createObj() {
|
||||
|
@ -247,6 +247,7 @@ public class TestSpec10_1_27 extends SQLListenerTestCase {
|
||||
|
||||
VicePresident vp = em.find(VicePresident.class, 1);
|
||||
assertVicePresident(vp);
|
||||
em.close();
|
||||
}
|
||||
|
||||
public void assertItem1(Item1 item) {
|
||||
|
@ -182,8 +182,8 @@ public class TestSpec10_1_27_Ex5 extends SQLListenerTestCase {
|
||||
c = em.find(Company.class, 1);
|
||||
assertCompany(c);
|
||||
deleteObj(em, c);
|
||||
*/
|
||||
em.close();
|
||||
*/
|
||||
}
|
||||
|
||||
public void updateObj1(EntityManager em, Company c) {
|
||||
|
@ -184,8 +184,8 @@ public class TestSpec10_1_27_Ex7 extends SQLListenerTestCase {
|
||||
c = em.find(Company.class, 1);
|
||||
assertCompany(c);
|
||||
deleteObj(em, c);
|
||||
*/
|
||||
em.close();
|
||||
*/
|
||||
}
|
||||
|
||||
public void updateObj1(EntityManager em, Company c) {
|
||||
|
@ -59,6 +59,7 @@ public class TestMapUpdate extends SQLListenerTestCase {
|
||||
ms = em.find(MultilingualString.class, entity1.getId());
|
||||
assertEquals("Good evening", ms.getText("en"));
|
||||
em.getTransaction().commit();
|
||||
em.close();
|
||||
}
|
||||
|
||||
public void testUpdateMapValue() throws Exception {
|
||||
@ -79,6 +80,7 @@ public class TestMapUpdate extends SQLListenerTestCase {
|
||||
// This assertion fails, the entity still has the old value.
|
||||
assertEquals("Good evening", ms.getText("en"));
|
||||
em.getTransaction().commit();
|
||||
em.close();
|
||||
}
|
||||
|
||||
private void createObj(EntityManagerFactory emf) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user