Search in sources :

Example 21 with CommandResult

use of org.springframework.shell.core.CommandResult in project tutorials by eugenp.

the class SimpleCLIIntegrationTest method givenCommandConfig_whenExecutingWebGetCommand_thenCorrectResult.

@Test
public void givenCommandConfig_whenExecutingWebGetCommand_thenCorrectResult() {
    final CommandResult resultWebSave = shell.executeCommand("web-get --url https://www.google.com");
    Assert.assertTrue(resultWebSave.isSuccess());
}
Also used : CommandResult(org.springframework.shell.core.CommandResult) Test(org.junit.Test)

Example 22 with CommandResult

use of org.springframework.shell.core.CommandResult in project tutorials by eugenp.

the class SimpleCLIIntegrationTest method givenCommandConfig_whenAdminEnableCommandExecuted_thenCorrectAvailability.

@Test
public void givenCommandConfig_whenAdminEnableCommandExecuted_thenCorrectAvailability() {
    final CommandResult resultAdminDisable = shell.executeCommand("admin-disable");
    final CommandResult resultWebSaveUnavailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
    final CommandResult resultAdminEnable = shell.executeCommand("admin-enable");
    final CommandResult resultWebSaveAvailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
    Assert.assertArrayEquals(new boolean[] { resultAdminDisable.isSuccess(), resultWebSaveUnavailable.isSuccess(), resultAdminEnable.isSuccess(), resultWebSaveAvailable.isSuccess() }, new boolean[] { true, false, true, true });
}
Also used : CommandResult(org.springframework.shell.core.CommandResult) Test(org.junit.Test)

Aggregations

CommandResult (org.springframework.shell.core.CommandResult)22 Test (org.junit.Test)19 JLineShellComponent (org.springframework.shell.core.JLineShellComponent)14 Bootstrap (org.springframework.shell.Bootstrap)11 ApplicationContext (org.springframework.context.ApplicationContext)8 PasswordPrompt (org.apache.rya.shell.util.PasswordPrompt)7 MiniAccumuloCluster (org.apache.accumulo.minicluster.MiniAccumuloCluster)6 LensClient (org.apache.lens.client.LensClient)3 JLineShell (org.springframework.shell.core.JLineShell)3 InstallConfiguration (org.apache.rya.api.client.Install.InstallConfiguration)2 ShellState (org.apache.rya.shell.SharedShellState.ShellState)2 InstallPrompt (org.apache.rya.shell.util.InstallPrompt)2 File (java.io.File)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 InterpreterResult (org.apache.zeppelin.interpreter.InterpreterResult)1