@Test public void testHandleUnknownCommand() { ctrlServer.handle("UnknownCommand"); verifyZeroInteractions(ctrlFile); verifyZeroInteractions(ctrlFileTailer); verifyZeroInteractions(eventBus); }
@Override public void handle(String command) { try { ControlCommand controlCommand = ControlCommand.valueOf(command.trim().toUpperCase()); switch (controlCommand) { case SHUTDOWN: logger.log(Level.INFO, "Control file: Received shutdown command. Shutting down."); eventBus.post(controlCommand); controlFileTailer.stop(); break; case RELOAD: logger.log(Level.INFO, "Control file: Received reload command. Reloading config ..."); eventBus.post(controlCommand); break; default: throw new RuntimeException("This command should have been handled."); } } catch (Exception e) { logger.log(Level.WARNING, "Control file: Ignoring unknown command: " + command, e); } }
ControlServer implements TailerListener { @Override public void handle(String command) { try { ControlCommand controlCommand = ControlCommand.valueOf(command.trim().toUpperCase()); switch (controlCommand) { case SHUTDOWN: logger.log(Level.INFO, "Control file: Received shutdown command. Shutting down."); eventBus.post(controlCommand); controlFileTailer.stop(); break; case RELOAD: logger.log(Level.INFO, "Control file: Received reload command. Reloading config ..."); eventBus.post(controlCommand); break; default: throw new RuntimeException("This command should have been handled."); } } catch (Exception e) { logger.log(Level.WARNING, "Control file: Ignoring unknown command: " + command, e); } } }
ControlServer implements TailerListener { @Override public void handle(String command) { try { ControlCommand controlCommand = ControlCommand.valueOf(command.trim().toUpperCase()); switch (controlCommand) { case SHUTDOWN: logger.log(Level.INFO, "Control file: Received shutdown command. Shutting down."); eventBus.post(controlCommand); controlFileTailer.stop(); break; case RELOAD: logger.log(Level.INFO, "Control file: Received reload command. Reloading config ..."); eventBus.post(controlCommand); break; default: throw new RuntimeException("This command should have been handled."); } } catch (Exception e) { logger.log(Level.WARNING, "Control file: Ignoring unknown command: " + command, e); } } ControlServer(); @Deprecated  ControlServer(File ctrlFile, Tailer ctrTailer, LocalEventBus eventBus); }
ControlServer implements TailerListener { @Override public void handle(String command) { try { ControlCommand controlCommand = ControlCommand.valueOf(command.trim().toUpperCase()); switch (controlCommand) { case SHUTDOWN: logger.log(Level.INFO, "Control file: Received shutdown command. Shutting down."); eventBus.post(controlCommand); controlFileTailer.stop(); break; case RELOAD: logger.log(Level.INFO, "Control file: Received reload command. Reloading config ..."); eventBus.post(controlCommand); break; default: throw new RuntimeException("This command should have been handled."); } } catch (Exception e) { logger.log(Level.WARNING, "Control file: Ignoring unknown command: " + command, e); } } ControlServer(); @Deprecated  ControlServer(File ctrlFile, Tailer ctrTailer, LocalEventBus eventBus); void enterLoop(); @Override void fileNotFound(); @Override void handle(String command); @Override void handle(Exception e); @Override void init(Tailer tailer); @Override void fileRotated(); }
ControlServer implements TailerListener { @Override public void handle(String command) { try { ControlCommand controlCommand = ControlCommand.valueOf(command.trim().toUpperCase()); switch (controlCommand) { case SHUTDOWN: logger.log(Level.INFO, "Control file: Received shutdown command. Shutting down."); eventBus.post(controlCommand); controlFileTailer.stop(); break; case RELOAD: logger.log(Level.INFO, "Control file: Received reload command. Reloading config ..."); eventBus.post(controlCommand); break; default: throw new RuntimeException("This command should have been handled."); } } catch (Exception e) { logger.log(Level.WARNING, "Control file: Ignoring unknown command: " + command, e); } } ControlServer(); @Deprecated  ControlServer(File ctrlFile, Tailer ctrTailer, LocalEventBus eventBus); void enterLoop(); @Override void fileNotFound(); @Override void handle(String command); @Override void handle(Exception e); @Override void init(Tailer tailer); @Override void fileRotated();  }