curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [1/2] curator git commit: make sure super.teardown() always gets called
Date Wed, 09 Sep 2015 00:23:05 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 5d30d07fb -> 75aa991e3


make sure super.teardown() always gets called


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/95281365
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/95281365
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/95281365

Branch: refs/heads/CURATOR-3.0
Commit: 952813659a4eb97ca4dffbbfe99f44f095846cf9
Parents: 5d30d07
Author: randgalt <randgalt@apache.org>
Authored: Tue Sep 8 19:14:31 2015 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue Sep 8 19:14:31 2015 -0500

----------------------------------------------------------------------
 .../imps/TestEnabledSessionExpiredState.java       | 11 ++++++++---
 .../recipes/nodes/TestPersistentEphemeralNode.java | 17 ++++++++++++-----
 .../java/org/apache/curator/x/rpc/RpcTests.java    | 11 ++++++++---
 3 files changed, 28 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/95281365/curator-framework/src/test/java/org/apache/curator/framework/imps/TestEnabledSessionExpiredState.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestEnabledSessionExpiredState.java
b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestEnabledSessionExpiredState.java
index 7114e48..f96592a 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestEnabledSessionExpiredState.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestEnabledSessionExpiredState.java
@@ -76,9 +76,14 @@ public class TestEnabledSessionExpiredState extends BaseClassForTests
     @Override
     public void teardown() throws Exception
     {
-        CloseableUtils.closeQuietly(client);
-
-        super.teardown();
+        try
+        {
+            CloseableUtils.closeQuietly(client);
+        }
+        finally
+        {
+            super.teardown();
+        }
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/curator/blob/95281365/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
index b62675e..899e65f 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
@@ -66,14 +66,21 @@ public class TestPersistentEphemeralNode extends BaseClassForTests
     @Override
     public void teardown() throws Exception
     {
-        for ( PersistentEphemeralNode node : createdNodes )
+        try
         {
-            node.close();
-        }
+            for ( PersistentEphemeralNode node : createdNodes )
+            {
+                node.close();
+            }
 
-        for ( CuratorFramework curator : curatorInstances )
+            for ( CuratorFramework curator : curatorInstances )
+            {
+                TestCleanState.closeAndTestClean(curator);
+            }
+        }
+        finally
         {
-            TestCleanState.closeAndTestClean(curator);
+            super.teardown();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/95281365/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
index a0e0a42..792eedd 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
@@ -100,9 +100,14 @@ public class RpcTests extends BaseClassForTests
     @Override
     public void teardown() throws Exception
     {
-        thriftServer.stop();
-
-        super.teardown();
+        try
+        {
+            thriftServer.stop();
+        }
+        finally
+        {
+            super.teardown();
+        }
     }
 
     @Test


Mime
View raw message