Author: ritchiem
Date: Mon Oct  5 15:00:20 2009
New Revision: 821820

URL: http://svn.apache.org/viewvc?rev=821820&view=rev
Log:
Update to ensure system properties are always reset even if exception ocurrs 
during tearDown

Modified:
    
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java

Modified: 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=821820&r1=821819&r2=821820&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
 (original)
+++ 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
 Mon Oct  5 15:00:20 2009
@@ -1021,14 +1021,19 @@
 
     protected void tearDown() throws java.lang.Exception
     {
-        // close all the connections used by this test.
-        for (Connection c : _connections)
+        try
         {
-            c.close();
+            // close all the connections used by this test.
+            for (Connection c : _connections)
+            {
+                c.close();
+            }
+        }
+        finally{
+            // Ensure any problems with close does not interfer with property 
resets
+            revertSystemProperties();
+            revertLoggingLevels();
         }
-
-        revertSystemProperties();
-        revertLoggingLevels();
     }
 
     /**



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to