SLIDER-395 testZKIntegration broken
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/b7f37ea2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b7f37ea2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b7f37ea2 Branch: refs/heads/develop Commit: b7f37ea2b1f6842fab57b37a6b54b08209b895aa Parents: bd0cdd1 Author: Steve Loughran <ste...@apache.org> Authored: Thu Sep 4 19:00:42 2014 +0100 Committer: Steve Loughran <ste...@apache.org> Committed: Thu Sep 4 19:00:42 2014 +0100 ---------------------------------------------------------------------- .../slider/common/tools/TestZKIntegration.groovy | 16 +++++++++++----- .../slider/test/YarnZKMiniClusterTestBase.groovy | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b7f37ea2/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy index c13af78..836edbd 100644 --- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy @@ -48,7 +48,8 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest @Test public void testIntegrationCreate() throws Throwable { assertHasZKCluster() - ZKIntegration zki = createZKIntegrationInstance(ZKBinding, "cluster1", true, false, 5000) + ZKIntegration zki = createZKIntegrationInstance( + getZKBinding(), "cluster1", true, false, 5000) String userPath = ZKIntegration.mkSliderUserPath(USER) Stat stat = zki.stat(userPath) assert stat != null @@ -59,7 +60,8 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest public void testListUserClustersWithoutAnyClusters() throws Throwable { assertHasZKCluster() - ZKIntegration zki = createZKIntegrationInstance(ZKBinding, "", true, false, 5000) + ZKIntegration zki = createZKIntegrationInstance( + getZKBinding(), "", true, false, 5000) String userPath = ZKIntegration.mkSliderUserPath(USER) List<String> clusters = zki.clusters assert clusters.empty @@ -69,7 +71,8 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest public void testListUserClustersWithOneCluster() throws Throwable { assertHasZKCluster() - ZKIntegration zki = createZKIntegrationInstance(ZKBinding, "", true, false, 5000) + ZKIntegration zki = createZKIntegrationInstance( + getZKBinding(), "", true, false, 5000) String userPath = ZKIntegration.mkSliderUserPath(USER) String fullPath = zki.createPath(userPath, "/cluster-", ZooDefs.Ids.OPEN_ACL_UNSAFE, @@ -82,7 +85,8 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest @Test public void testListUserClustersWithTwoCluster() throws Throwable { - ZKIntegration zki = createZKIntegrationInstance(ZKBinding, "", true, false, 5000) + ZKIntegration zki = createZKIntegrationInstance( + getZKBinding(), "", true, false, 5000) String userPath = ZKIntegration.mkSliderUserPath(USER) String c1 = createEphemeralChild(zki, userPath) log.info("Ephemeral path $c1") @@ -110,6 +114,7 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest path = client.createZookeeperNode("cl1", false) zki = client.lastZKIntegration + assert zki assert zkPath == "/services/slider/users/" + USER + "/cl1", "zkPath must be as expected" assert path == zkPath assert zki.exists(zkPath) @@ -135,7 +140,8 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest @Override protected ZKIntegration getZkClient(String clusterName, String user) { - createZKIntegrationInstance(ZKBinding, "cl1", true, false, 5000) + zki = createZKIntegrationInstance(getZKBinding(), "cl1", true, false, 5000) + return zki; } @Override http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b7f37ea2/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy index 0259fb7..9b5f082 100644 --- a/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy @@ -147,7 +147,7 @@ public abstract class YarnZKMiniClusterTestBase extends YarnMiniClusterTestBase assert microZKCluster != null } - protected String getZKBinding() { + public String getZKBinding() { if (!microZKCluster) { return "localhost:1" } else {