NamespaceFacade should not overload createContainers(). It was losing the namespace
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f4f22082 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f4f22082 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f4f22082 Branch: refs/heads/CURATOR-267 Commit: f4f2208240cf6c76067f3ae1b5fbe58b46ac2478 Parents: 1556a2f Author: randgalt <randg...@apache.org> Authored: Tue Oct 6 08:21:05 2015 -0500 Committer: randgalt <randg...@apache.org> Committed: Tue Oct 6 08:21:05 2015 -0500 ---------------------------------------------------------------------- .../org/apache/curator/framework/imps/NamespaceFacade.java | 7 ------- .../java/org/apache/curator/framework/imps/TestFramework.java | 6 +++--- 2 files changed, 3 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/f4f22082/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java index a4bb2e5..95bf132 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java @@ -43,13 +43,6 @@ class NamespaceFacade extends CuratorFrameworkImpl } @Override - public void createContainers(String path) throws Exception - { - path = fixForNamespace(path); - client.createContainers(path); - } - - @Override public CuratorFramework nonNamespaceView() { return usingNamespace(null); http://git-wip-us.apache.org/repos/asf/curator/blob/f4f22082/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java index b6a0a40..8aa37c0 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java @@ -599,9 +599,9 @@ public class TestFramework extends BaseClassForTests final String namespace = "container1"; CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); CuratorFramework client = builder.connectString(server.getConnectString()).retryPolicy(new RetryOneTime(1)).namespace(namespace).build(); - client.start(); try { + client.start(); String path = "/path1/path2"; client.createContainers(path); Assert.assertNotNull(client.checkExists().forPath(path)); @@ -620,10 +620,10 @@ public class TestFramework extends BaseClassForTests final String namespace = "container2"; CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); CuratorFramework client = builder.connectString(server.getConnectString()).retryPolicy(new RetryOneTime(1)).build(); - client.start(); - CuratorFramework nsClient = client.usingNamespace(namespace); try { + client.start(); + CuratorFramework nsClient = client.usingNamespace(namespace); String path = "/path1/path2"; nsClient.createContainers(path); Assert.assertNotNull(nsClient.checkExists().forPath(path));