@Test
public void testHandleCommand() {

  Execable ex = new Execable() {
    @Override
    public void exec(String[] args) throws MasterExecException, IOException {
      throw new IllegalArgumentException("failure here");
    }
  };
  CommandManager cmdman = new CommandManager();
  cmdman.addCommand("err", ex);
  cmdman.handleCommand(null); // do nothing.
  // submit a error command
  long id = cmdman.submit(new Command("err"));
  CommandStatus stat = cmdman.getStatus(id);
  cmdman.handleCommand(stat);
  assertTrue(cmdman.isFailure(id));
  id = cmdman.submit(new Command("noop"));
  stat = cmdman.getStatus(id);
  cmdman.handleCommand(stat);
  assertTrue(cmdman.isSuccess(id));
}