Package org.jboss.as.test.integration.management.util

Examples of org.jboss.as.test.integration.management.util.CLIWrapper.readAllUnformated()


    @Test
    public void testLs() throws Exception {
        CLIWrapper cli = new CLIWrapper(true);
        cli.sendLine("ls", true);
        String ls = cli.readAllUnformated(5000, 500);

        assertTrue(ls.contains("subsystem"));
        assertTrue(ls.contains("interface"));
        assertTrue(ls.contains("extension"));
        assertTrue(ls.contains("subsystem"));
View Full Code Here


    }
   
    @Test
    public void testVersionArgument() throws Exception {
        CLIWrapper cli = new CLIWrapper(false, new String[] {"--version"});
        String output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertTrue(output.contains("JBOSS_HOME"));
        Assert.assertTrue(cli.hasQuit());
    }

    @Test
View Full Code Here

    }

    @Test
    public void testCommandArgument() throws Exception {
        CLIWrapper cli = new CLIWrapper(false, new String[] {"--command=version"});
        String output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertTrue(output.contains("JBOSS_HOME"));
        Assert.assertTrue(cli.hasQuit());
    }

    @Test
View Full Code Here

    }

    @Test
    public void testCommandsArgument() throws Exception {
        CLIWrapper cli = new CLIWrapper(false, new String[] {getControllerString(), "--commands=version,connect,ls"});
        String output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertTrue("CLI Output: " + output, output.contains("JBOSS_HOME"));
        Assert.assertTrue("CLI Output: " + output, output.contains("subsystem"));
        Assert.assertTrue("CLI Output: " + output, output.contains("extension"));
       
        Assert.assertTrue(cli.hasQuit());
View Full Code Here

        if (cliScriptFile.exists()) Assert.assertTrue(cliScriptFile.delete());
        FileUtils.writeStringToFile(cliScriptFile, "version" + System.getProperty("line.separator"));
       
        // pass it to CLI
        CLIWrapper cli = new CLIWrapper(false, new String[] {"--file=" + cliScriptFile.getAbsolutePath()});
        String output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertTrue(output.contains("JBOSS_HOME"));
        Assert.assertTrue(cli.hasQuit());     
       
        cliScriptFile.delete();
    }
View Full Code Here

    }
   
    @Test
    public void testConnectArgument() throws Exception {
        CLIWrapper cli = new CLIWrapper(false, new String[] {getControllerString(), "--commands=version,connect,ls"});
        String output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertTrue(output.contains("JBOSS_HOME"));
        Assert.assertTrue(output.contains("subsystem"));
        Assert.assertTrue(output.contains("extension"));       
        Assert.assertTrue(cli.hasQuit());
    }   
View Full Code Here

    public void testControlerArgument() throws Exception {
        String controller = getControllerString();
        CLIWrapper cli = new CLIWrapper(false, new String[] {controller});
        cli.sendLine("connect");
        cli.sendLine("ls");
        String output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertTrue(output.contains("subsystem"));
        Assert.assertTrue(output.contains("extension"));       
        cli.quit();
       
        cli = new CLIWrapper(false, new String[] {getControllerString(-1)});
View Full Code Here

        Assert.assertTrue(output.contains("extension"));       
        cli.quit();
       
        cli = new CLIWrapper(false, new String[] {getControllerString(-1)});
        cli.sendLine("connect");
        output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT * 10);
        Assert.assertTrue(output.contains("The controller is not available"));
        cli.quit();       
    }

    private String getControllerString() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.