this.done = false;
this.cmd = null;
this.cmdIndex = 0;
this.readWait = false;
this.output = new StringBuilderOutputStream();
ConsoleReader reader = new ConsoleReader(this, new OutputStreamWriter(output));
this.shell = new Shell(reader, new PrintWriter(output));
shell.setLogErrorsToConsole();
if (mock != null) {
if (shell.config("--fake", "-u", username, "-p", password))
throw new IOException("mock shell config error");