/** * Execute a command in the provided 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 shell * Shell in which to execute the command. * @param command * Command to execute * @return The result of the command execution */ protected CommandResult executeCommandWithoutClear(TestableGfsh shell, String command) { assert(shell != null); assert(command != null); try { info("Executing command " + command + " with command Mgr " + CommandManager.getInstance()); } catch (ClassNotFoundException cnfex) { throw new TestException(TestHelper.getStackTrace(cnfex)); } catch (IOException ioex) { throw new TestException(TestHelper.getStackTrace(ioex)); } try { shell.addChars(command).addChars(";").newline(); } catch (IOException ioex) { throw new TestException(TestHelper.getStackTrace(ioex)); } shell.waitForOutput(); return extractCommandResult(shell.getCommandOutput()); }