HadoopLaunchHandler { void stopCluster() throws IOException, InterruptedException { String stopCmd = configuration.get("calvalus.openstack.startcmd").replaceAll("startup", "shutdown"); LOG.info(stopCmd); Process process = Runtime.getRuntime().exec(stopCmd,null, new File(configuration.get("calvalus.openstack.workdir"))); new ProcessObserver(process).start(); if (process.waitFor() != 0) { throw new IOException(stopCmd + " failed"); } configuration.unset("yarn.resourcemanager.hostname"); configuration.unset("yarn.resourcemanager.address"); configuration.unset("mapreduce.jobhistory.address"); configuration.unset("mapreduce.jobhistory.webapp.address"); configuration.unset("yarn.log.server.url"); } HadoopLaunchHandler(Configuration configuration);  HadoopLaunchHandler(HadoopProcessingService hadoopProcessingService, Configuration configuration); void queueWorkflowItem(HadoopWorkflowItem workflowItem);  }
@Ignore @Test public void testStopCluster() throws IOException, InterruptedException { Configuration configuration = new Configuration(); configuration.set("calvalus.openstack.workdir", "/home/martin/tmp/dias-inst"); configuration.set("calvalus.openstack.startcmd", "./cdt.py mundi startup s2-c2rcc-test-request.json"); new HadoopLaunchHandler(configuration).stopCluster(); assertEquals("launched master", null, configuration.get("calvalus.hadoop.yarn.resourcemanager.hostname")); }