openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r1006009 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java
Date Fri, 08 Oct 2010 20:30:58 GMT
Author: dwoods
Date: Fri Oct  8 20:30:57 2010
New Revision: 1006009

URL: http://svn.apache.org/viewvc?rev=1006009&view=rev
Log:
close streams

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java?rev=1006009&r1=1006008&r2=1006009&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/utils/AbstractTestCase.java
Fri Oct  8 20:30:57 2010
@@ -139,6 +139,7 @@ public abstract class AbstractTestCase e
             for (EntityManagerFactory emf : emfs.values()) {
                 try {
                     closeEMF(emf);
+                    emf = null;
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
@@ -576,9 +577,14 @@ public abstract class AbstractTestCase e
         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;



Mime
View raw message