assertEquals(Integer.valueOf(2181),
Integer.valueOf(properties.getProperty("clientPort")));
assertEquals("localhost:2888:3888", properties.get("server.0"));
HQuorumPeer.writeMyID(properties);
QuorumPeerConfig config = new QuorumPeerConfig();
config.parseProperties(properties);
assertEquals(this.dataDir.toString(), config.getDataDir());
assertEquals(2181, config.getClientPortAddress().getPort());
Map<Long,QuorumServer> servers = config.getServers();
assertEquals(3, servers.size());
assertTrue(servers.containsKey(Long.valueOf(0)));
QuorumServer server = servers.get(Long.valueOf(0));
assertEquals("localhost", server.addr.getHostName());
// Override with system property.
System.setProperty("hbase.master.hostname", "foo.bar");
is = new ByteArrayInputStream(s.getBytes());
properties = ZKConfig.parseZooCfg(conf, is);
assertEquals("foo.bar:2888:3888", properties.get("server.0"));
config.parseProperties(properties);
servers = config.getServers();
server = servers.get(Long.valueOf(0));
assertEquals("foo.bar", server.addr.getHostName());
}