String dir = getTestDir().getAbsolutePath();
String services = StringUtils.toString(Arrays.asList(InstrumentationService.class.getName(),
HadoopService.class.getName()), ",");
XConfiguration conf = new XConfiguration();
conf.set("server.services", services);
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
HadoopService hadoop = (HadoopService) server.get(Hadoop.class);
hadoop.validateJobtracker("JT");
hadoop.validateNamenode("NN");
server.destroy();
conf = new XConfiguration();
conf.set("server.services", services);
conf.set("server.hadoop.job.tracker.whitelist", "*");
conf.set("server.hadoop.name.node.whitelist", "*");
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
hadoop = (HadoopService) server.get(Hadoop.class);
hadoop.validateJobtracker("JT");
hadoop.validateNamenode("NN");
server.destroy();
conf = new XConfiguration();
conf.set("server.services", services);
conf.set("server.hadoop.job.tracker.whitelist", "JT");
conf.set("server.hadoop.name.node.whitelist", "NN");
server = new Server("server", dir, dir, dir, dir, conf);
server.init();
hadoop = (HadoopService) server.get(Hadoop.class);
hadoop.validateJobtracker("JT");
hadoop.validateNamenode("NN");
server.destroy();
}