.setZkTimeout(5000).setJournalDirName(tmpDir.getPath())
.setLedgerDirNames(new String[] { tmpDir.getPath() });
conf.setZkLedgersRootPath(ZK_ROOT);
try {
try {
new Bookie(conf);
fail("Should throw NoNodeException");
} catch (Exception e) {
// shouldn't be able to start
}
ClientConfiguration clientConf = new ClientConfiguration();
clientConf.setZkServers(zkutil.getZooKeeperConnectString());
clientConf.setZkLedgersRootPath(ZK_ROOT);
BookKeeperAdmin.format(clientConf, false, false);
Bookie b = new Bookie(conf);
b.shutdown();
} finally {
FileUtils.deleteDirectory(tmpDir);
}
}