make sure tests cleanup EMs and EMFs

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1021970 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2010-10-13 01:15:25 +00:00
parent 1edd0d97c1
commit 7b6b4157d0
10 changed files with 94 additions and 0 deletions

View File

@ -60,6 +60,15 @@ public class TestDelimIdResultSetAnnotations
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
@Override
protected OpenJPAEntityManagerFactorySPI createEMF(final Object... props) {
return createNamedEMF("delimited-identifiers", props);

View File

@ -54,6 +54,15 @@ public class TestDelimIdSeqGen extends SQLListenerTestCase {
}
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
@Override
protected OpenJPAEntityManagerFactorySPI createEMF(final Object... props) {
return createNamedEMF("delimited-identifiers", props);

View File

@ -52,6 +52,15 @@ public class TestDelimInheritance extends SQLListenerTestCase {
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
@Override
protected OpenJPAEntityManagerFactorySPI createEMF(final Object... props) {
return createNamedEMF("delimited-identifiers", props);

View File

@ -43,6 +43,15 @@ public class TestDelimitedIdentifiers extends SQLListenerTestCase {
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
@Override
protected OpenJPAEntityManagerFactorySPI createEMF(final Object... props) {
return createNamedEMF("delimited-identifiers", props);

View File

@ -57,6 +57,15 @@ public class TestDelimitedJoinAnnotation extends SQLListenerTestCase {
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
@Override
protected OpenJPAEntityManagerFactorySPI createEMF(final Object... props) {
return createNamedEMF("delimited-identifiers", props);

View File

@ -49,6 +49,15 @@ public class TestManualDelimId extends SQLListenerTestCase {
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
public void createEntityF() {
entityF = new EntityF("fName");
entityF.setNonDelimName("fNonDelimName");

View File

@ -61,6 +61,15 @@ public class TestManualDelimIdResultSetAnnotations
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
private void createCat(int id) {
cat = new Cat(id);
cat.setName("Puff");

View File

@ -55,6 +55,17 @@ public class TestManualDelimIdSeqGen extends SQLListenerTestCase {
}
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
dict = null;
conf = null;
super.tearDown();
}
public void createEntityE() {
entityE = new EntityE("e name");
}

View File

@ -53,6 +53,15 @@ public class TestManualDelimInheritance extends SQLListenerTestCase {
assertNotNull(em);
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
super.tearDown();
}
private void createDog(int id) {
dog = new Dog(id);
dog.setName("Spot");

View File

@ -65,6 +65,17 @@ public class TestManualDelimitedJoinAnnotations extends SQLListenerTestCase {
dict = conf.getDBDictionaryInstance();
}
@Override
public void tearDown() throws Exception {
if (em != null && em.isOpen()) {
em.close();
em = null;
}
dict = null;
conf = null;
super.tearDown();
}
private void createCandD(int id) {
entityC = new EntityC(id);
entityC.setName("ec");