Package org.springframework.shell.core

Examples of org.springframework.shell.core.JLineShellComponent.executeCommand()


  @Test
  public void testShellWithMissingUsername() throws Exception {
    Bootstrap bootstrap = new Bootstrap();
    JLineShellComponent shell = bootstrap.getJLineShellComponent();
    CommandResult commandResult = shell.executeCommand("admin config server --uri http://localhost:" + adminPort + " --password whosThere");
    assertThat(commandResult.isSuccess(), is(true));
    Configuration configuration = bootstrap.getApplicationContext().getBean(Configuration.class);
    assertThat(configuration.getTarget().getTargetException(), instanceOf(IllegalArgumentException.class));
    assertThat(configuration.getTarget().getTargetException().getMessage(), equalTo("A password may be specified only together with a user name"));
    commandResult = shell.executeCommand("module list");
View Full Code Here


    CommandResult commandResult = shell.executeCommand("admin config server --uri http://localhost:" + adminPort + " --password whosThere");
    assertThat(commandResult.isSuccess(), is(true));
    Configuration configuration = bootstrap.getApplicationContext().getBean(Configuration.class);
    assertThat(configuration.getTarget().getTargetException(), instanceOf(IllegalArgumentException.class));
    assertThat(configuration.getTarget().getTargetException().getMessage(), equalTo("A password may be specified only together with a user name"));
    commandResult = shell.executeCommand("module list");
    assertThat(commandResult.isSuccess(), is(false));
  }

  @AfterClass
  public static void tearDown() throws Exception {
View Full Code Here

  public void testSimple() {
    Bootstrap bootstrap = new Bootstrap();
   
    JLineShellComponent shell = bootstrap.getJLineShellComponent();
   
    CommandResult cr = shell.executeCommand("hw simple --message hello");
    assertEquals(true, cr.isSuccess());
    assertEquals("Message = [hello] Location = [null]", cr.getResult());
  }
}
View Full Code Here

    if (null != commandsToExecuteAndThenQuit) {
      boolean successful = false;
      exitShellRequest = ExitShellRequest.FATAL_EXIT;

      for (String cmd : commandsToExecuteAndThenQuit) {
        successful = shell.executeCommand(cmd).isSuccess();
        if (!successful)
          break;
      }

      // if all commands were successful, set the normal exit status
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.