close streams

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1006009 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2010-10-08 20:30:57 +00:00
parent 733d90cea6
commit 9c87751ae7
1 changed files with 9 additions and 3 deletions

View File

@ -139,6 +139,7 @@ public abstract class AbstractTestCase extends AbstractCachedEMFTestCase {
for (EntityManagerFactory emf : emfs.values()) {
try {
closeEMF(emf);
emf = null;
} catch (Exception e) {
e.printStackTrace();
}
@ -576,9 +577,14 @@ public abstract class AbstractTestCase extends AbstractCachedEMFTestCase {
ObjectInputStream in = new ObjectInputStream(bin);
Object result = in.readObject();
if (validateEquality) {
assertEquals(orig.hashCode(), result.hashCode());
assertEquals(orig, result);
try {
if (validateEquality) {
assertEquals(orig.hashCode(), result.hashCode());
assertEquals(orig, result);
}
} finally {
out.close();
in.close();
}
return result;