Merge branch 'master' into CURATOR-3.0
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/41a70042 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/41a70042 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/41a70042 Branch: refs/heads/CURATOR-3.0 Commit: 41a700429ad8cc57d96fe205164fbfc263673c22 Parents: 073ed35 d63e06e Author: randgalt <[email protected]> Authored: Sun May 22 22:31:31 2016 -0500 Committer: randgalt <[email protected]> Committed: Sun May 22 22:31:31 2016 -0500 ---------------------------------------------------------------------- .../framework/imps/ExistsBuilderImpl.java | 6 +++- .../framework/imps/TestFrameworkEdges.java | 38 ++++++++++++++++++++ .../recipes/cache/TestPathChildrenCache.java | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/41a70042/curator-framework/src/main/java/org/apache/curator/framework/imps/ExistsBuilderImpl.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/41a70042/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java ---------------------------------------------------------------------- diff --cc curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java index 70290ab,553fcb7..bf1c281 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java @@@ -57,21 -60,42 +59,57 @@@ public class TestFrameworkEdges extend private final Timing timing = new Timing(); @Test + public void testCreateContainersForBadConnect() throws Exception + { + final int serverPort = server.getPort(); + server.close(); + + CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), 1000, 1000, new RetryForever(100)); + try + { + new Thread() + { + @Override + public void run() + { + try + { + Thread.sleep(3000); + server = new TestingServer(serverPort, true); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + }.start(); + + client.start(); + client.createContainers("/this/does/not/exist"); + Assert.assertNotNull(client.checkExists().forPath("/this/does/not/exist")); + } + finally + { + CloseableUtils.closeQuietly(client); + } + } + + @Test + public void testQuickClose() throws Exception + { + CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), 1, new RetryNTimes(0, 0)); + try + { + client.start(); + client.close(); + } + finally + { + CloseableUtils.closeQuietly(client); + } + } + + @Test public void testProtectedCreateNodeDeletion() throws Exception { CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), 1, new RetryNTimes(0, 0)); http://git-wip-us.apache.org/repos/asf/curator/blob/41a70042/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java ---------------------------------------------------------------------- diff --cc curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java index 49cbb4c,887df54..39fbf66 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java @@@ -642,8 -634,7 +642,8 @@@ public class TestPathChildrenCache exte } finally { - CloseableUtils.closeQuietly(cache); - client.close(); ++ CloseableUtils.closeQuietly(cache);â + TestCleanState.closeAndTestClean(client); } }
