Code example for ByteArrayOutputStream

Methods: reset

0
     * @param ignoreError if set to false, asserts that handling the line did not result in a {@link org.jboss.as.cli.CommandLineException}. 
     * 
     * @return true if the CLI is in a non-error state following handling the line 
     */ 
    public boolean sendLine(String line, boolean ignoreError)  {
        consoleOut.reset();
        if(ignoreError) {
            ctx.handleSafe(line);
            return ctx.getExitCode() == 0;
        } else { 
            try { 
                ctx.handle(line);
            } catch (CommandLineException e) {
                Assert.fail("Failed to execute line '" + line + "': " + e.getLocalizedMessage());
            } 
        } 
        return true; 
    } 
 
    /** 
Connect your IDE to all the code out there  Get Codota for Java