@Test @Ignore("broken") public void testContexts() { SpringLoader.main(new String[] { "start" }); ServiceDaemon daemon = (ServiceDaemon)Registry.getBean("collectd"); assertEquals(Fiber.RUNNING, daemon.getStatus()); }
public static void main(String[] args) { try { String cmd = args[0]; if ("-u".equals(cmd)) { cmd = args[2]; } SpringLoader loader = new SpringLoader(cmd); if ("start".equals(cmd)) loader.start(); else if ("stop".equals(cmd)) loader.stop(); else if ("pause".equals(cmd)) loader.pause(); else if ("resume".equals(cmd)) loader.resume(); else if ("status".equals(cmd)) loader.status(); else usage(); } catch (ConnectException e) { System.err.println("opennms is not running."); System.exit(3); } catch (Throwable e) { System.err.println("Exception occurred: "+e); e.printStackTrace(); System.exit(2); } }
SpringLoader { public static void main(String[] args) { try { String cmd = args[0]; if ("-u".equals(cmd)) { cmd = args[2]; } SpringLoader loader = new SpringLoader(cmd); if ("start".equals(cmd)) loader.start(); else if ("stop".equals(cmd)) loader.stop(); else if ("pause".equals(cmd)) loader.pause(); else if ("resume".equals(cmd)) loader.resume(); else if ("status".equals(cmd)) loader.status(); else usage(); } catch (ConnectException e) { System.err.println("opennms is not running."); System.exit(3); } catch (Throwable e) { System.err.println("Exception occurred: "+e); e.printStackTrace(); System.exit(2); } } }
SpringLoader { public static void main(String[] args) { try { String cmd = args[0]; if ("-u".equals(cmd)) { cmd = args[2]; } SpringLoader loader = new SpringLoader(cmd); if ("start".equals(cmd)) loader.start(); else if ("stop".equals(cmd)) loader.stop(); else if ("pause".equals(cmd)) loader.pause(); else if ("resume".equals(cmd)) loader.resume(); else if ("status".equals(cmd)) loader.status(); else usage(); } catch (ConnectException e) { System.err.println("opennms is not running."); System.exit(3); } catch (Throwable e) { System.err.println("Exception occurred: "+e); e.printStackTrace(); System.exit(2); } } SpringLoader(String operation); }
SpringLoader { public static void main(String[] args) { try { String cmd = args[0]; if ("-u".equals(cmd)) { cmd = args[2]; } SpringLoader loader = new SpringLoader(cmd); if ("start".equals(cmd)) loader.start(); else if ("stop".equals(cmd)) loader.stop(); else if ("pause".equals(cmd)) loader.pause(); else if ("resume".equals(cmd)) loader.resume(); else if ("status".equals(cmd)) loader.status(); else usage(); } catch (ConnectException e) { System.err.println("opennms is not running."); System.exit(3); } catch (Throwable e) { System.err.println("Exception occurred: "+e); e.printStackTrace(); System.exit(2); } } SpringLoader(String operation); void start(); static void main(String[] args); }
SpringLoader { public static void main(String[] args) { try { String cmd = args[0]; if ("-u".equals(cmd)) { cmd = args[2]; } SpringLoader loader = new SpringLoader(cmd); if ("start".equals(cmd)) loader.start(); else if ("stop".equals(cmd)) loader.stop(); else if ("pause".equals(cmd)) loader.pause(); else if ("resume".equals(cmd)) loader.resume(); else if ("status".equals(cmd)) loader.status(); else usage(); } catch (ConnectException e) { System.err.println("opennms is not running."); System.exit(3); } catch (Throwable e) { System.err.println("Exception occurred: "+e); e.printStackTrace(); System.exit(2); } } SpringLoader(String operation); void start(); static void main(String[] args);  }