/**
* @throws IOException
*/
public void testWritesRootRegionLocation() throws IOException {
ZooKeeperWrapper zooKeeper = new ZooKeeperWrapper(conf, EmptyWatcher.instance);
boolean outOfSafeMode = zooKeeper.checkOutOfSafeMode();
assertFalse(outOfSafeMode);
HServerAddress zooKeeperRootAddress = zooKeeper.readRootRegionLocation();
assertNull(zooKeeperRootAddress);
HMaster master = cluster.getMaster();
HServerAddress masterRootAddress = master.getRootRegionLocation();
assertNull(masterRootAddress);
new HTable(conf, HConstants.META_TABLE_NAME);
outOfSafeMode = zooKeeper.checkOutOfSafeMode();
assertTrue(outOfSafeMode);
zooKeeperRootAddress = zooKeeper.readRootRegionLocation();
assertNotNull(zooKeeperRootAddress);
masterRootAddress = master.getRootRegionLocation();
assertEquals(masterRootAddress, zooKeeperRootAddress);
}