/** * Execute a command using the default shell. Useful for getting additional information from the shell after the * command has been executed (using getDefaultShell().???). Caller is responsible for calling * getDefaultShell().clearEvents() when done. * * @param command * Command to execute * @return The result of the command execution */ @SuppressWarnings("unused") protected CommandResult executeCommandWithoutClear(String command) { assert(command != null); return executeCommandWithoutClear(getDefaultShell(), command); }
/** * Execute a command in the provided shell and clear the shell events before returning. * * @param shell * Shell in which to execute the command. * @param command * Command to execute * @return The result of the command execution */ protected CommandResult executeCommand(TestableGfsh shell, String command) { assert(shell != null); assert(command != null); CommandResult commandResult = executeCommandWithoutClear(shell, command); shell.clearEvents(); return commandResult; }