Package org.apache.whirr.command

Examples of org.apache.whirr.command.Command


    assertThat(bytes.toString(), containsString("Unrecognized command 'bogus-command'"));
  }
 
  @Test
  public void testCommand() throws Exception {
    Command command = mock(Command.class);
    when(command.getName()).thenReturn("mock-command");
    Main main = new Main(command);
    main.run(null, null, null, Lists.newArrayList("mock-command", "arg1", "arg2"));
    verify(command).run(null, null, null, Lists.newArrayList("arg1", "arg2"));
  }
View Full Code Here


      List<String> list) throws Exception {
    if (list.isEmpty()) {
      printUsage(out);
      return -1;
    }
    Command command = commandMap.get(list.get(0));
    if (command == null) {
      err.printf("Unrecognized command '%s'\n", list.get(0));
      err.println();
      printUsage(err);
      return -1;
    }
    return command.run(in, out, err, list.subList(1, list.size()));
  }
View Full Code Here

      List<String> list) throws Exception {
    if (list.isEmpty()) {
      printUsage(out);
      return -1;
    }
    Command command = commandMap.get(list.get(0));
    if (command == null) {
      err.printf("Unrecognized command '%s'\n", list.get(0));
      err.println();
      printUsage(err);
      return -1;
    }
    return command.run(in, out, err, list.subList(1, list.size()));
  }
View Full Code Here

    assertThat(bytes.toString(), containsString("Unrecognized command 'bogus-command'"));
  }
 
  @Test
  public void testCommand() throws Exception {
    Command command = mock(Command.class);
    when(command.getName()).thenReturn("mock-command");
    Main main = new Main(command);
    main.run(null, null, null, Lists.newArrayList("mock-command", "arg1", "arg2"));
    verify(command).run(null, null, null, Lists.newArrayList("arg1", "arg2"));
  }
View Full Code Here

TOP

Related Classes of org.apache.whirr.command.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.