@Test
  public void testHostPortParse() {
    ZKMainServer parser = new ZKMainServer();
    Configuration c = HBaseConfiguration.create();
    assertEquals("127.0.0.1:" + c.get(HConstants.ZOOKEEPER_CLIENT_PORT), parser.parse(c));
    final String port = "1234";
    c.set(HConstants.ZOOKEEPER_CLIENT_PORT, port);
    c.set("hbase.zookeeper.quorum", "example.com");
    assertEquals("example.com:" + port, parser.parse(c));
    c.set("hbase.zookeeper.quorum", "example1.com,example2.com,example3.com");
    String ensemble = parser.parse(c);
    assertTrue(port, ensemble.matches("(example[1-3]\\.com:1234,){2}example[1-3]\\.com:" + port));

    // multiple servers with its own port
    c.set("hbase.zookeeper.quorum", "example1.com:5678,example2.com:9012,example3.com:3456");
    ensemble = parser.parse(c);
    assertEquals("example1.com:5678,example2.com:9012,example3.com:3456", ensemble);

    // some servers without its own port, which will be assigned the default client port
    c.set("hbase.zookeeper.quorum", "example1.com:5678,example2.com:9012,example3.com");
    ensemble = parser.parse(c);
    assertEquals(ensemble, "example1.com:5678,example2.com:9012,example3.com:" + port);

    // multiple servers(IPv6) with its own port
    c.set("hbase.zookeeper.quorum",
      "[2001:db8:1::242:ac11:2]:2181," + "[2001:db8:1::242:ac11:3]:5678");
    ensemble = parser.parse(c);
    assertEquals("[2001:db8:1::242:ac11:2]:2181," + "[2001:db8:1::242:ac11:3]:5678", ensemble);

    // some servers(IPv6) without its own port, which will be assigned the default client port
    c.set("hbase.zookeeper.quorum",
      "[1001:db8:1::242:ac11:8], [2001:db8:1::242:df23:2]:9876," + "[2001:db8:1::242:ac11:3]:5678");
    ensemble = parser.parse(c);
    assertEquals("[1001:db8:1::242:ac11:8]:1234, [2001:db8:1::242:df23:2]:9876,"
      + "[2001:db8:1::242:ac11:3]:5678", ensemble);

    // a bad case
    try {
      // some servers(IPv6) with an invaild Ipv6 address in it
      c.set("hbase.zookeeper.quorum", "[1001:db8:1::242:ac11:8], [2001:db8:1::242:df23:2]:9876,"
        + "[1001:db8:1::242:ac11:8:89:67]:5678");
      parser.parse(c);
      Assert.fail("IPv6 address should be 8 groups.");
    } catch (IllegalArgumentException e) {
      // expected
    }
  }
We need delete of a znode to work at least.
hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMainServer.java