summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-10-05 15:00:20 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-10-05 15:00:20 +0000
commitf7564d58f97f67b2e3d96e4158b2a6d9338c3efd (patch)
treea91efc9a82fa54753303aaf64f7ee2a3f1c6310e /java
parentf631c150f37ece2ccf9ef69a91bc7fb821691c74 (diff)
downloadqpid-python-f7564d58f97f67b2e3d96e4158b2a6d9338c3efd.tar.gz
Update to ensure system properties are always reset even if exception ocurrs during tearDown
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@821820 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
index 666c97c9de..95ce3a06b5 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
@@ -1021,14 +1021,19 @@ public class QpidTestCase extends TestCase
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();
}
/**