public void testChRootCreateDelete() throws Exception {
// creating the subtree for chRoot clients.
String chRoot = createNameSpace();
// Creating child using chRoot client.
zk_chroot = createClient(this.hostPort + chRoot);
Op createChild = Op.create("/myid", new byte[0],
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
multi(zk_chroot, Arrays.asList(createChild));
Assert.assertNotNull("zNode is not created under chroot:" + chRoot, zk
.exists(chRoot + "/myid", false));
Assert.assertNotNull("zNode is not created under chroot:" + chRoot,
zk_chroot.exists("/myid", false));
Assert.assertNull("zNode is created directly under '/', ignored configured chroot",
zk.exists("/myid", false));
// Deleting child using chRoot client.
Op deleteChild = Op.delete("/myid", 0);
multi(zk_chroot, Arrays.asList(deleteChild));
Assert.assertNull("zNode exists under chroot:" + chRoot, zk.exists(
chRoot + "/myid", false));
Assert.assertNull("zNode exists under chroot:" + chRoot, zk_chroot
.exists("/myid", false));