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

Examples of org.jboss.as.test.integration.management.util.CLIWrapper


*/
public class BasicOpsTestCase {

    @Test
    public void testConnect() throws Exception {
        CLIWrapper cli = new CLIWrapper(false, DomainTestSupport.masterAddress);

        // wait for cli welcome message
        String line = cli.readLine(WAIT_TIMEOUT);

        while(! line.contains("You are disconnected")) {
            line = cli.readLine(WAIT_TIMEOUT);
        }

        cli.sendConnect(DomainTestSupport.masterAddress);
        line = cli.readLine(WAIT_TIMEOUT);

        assertTrue("Check we are disconnected:" + line, line.indexOf("disconnected") >= 0);
        cli.sendLine("version", false);
        line = cli.readLine(WAIT_TIMEOUT);
        assertTrue("Connect failed:" + line, line.indexOf("[domain@") >= 0);
        cli.quit();

    }
View Full Code Here


    }

    @Test
    public void testDomainSetup() throws Exception {
        CLIWrapper cli = new CLIWrapper(false, DomainTestSupport.masterAddress);

        // wait for cli welcome message
        String line = cli.readLine(WAIT_TIMEOUT);

        while(! line.contains("You are disconnected")) {
            line = cli.readLine(WAIT_TIMEOUT);
        }

        cli.sendConnect(DomainTestSupport.masterAddress);
        line = cli.readLine(WAIT_TIMEOUT);

        assertTrue("Check we are disconnected:" + line, line.indexOf("disconnected") >= 0);
        cli.sendLine("version", false);
        line = cli.readLine(WAIT_TIMEOUT);
        assertTrue("Connect failed:" + line, line.indexOf("[domain@") >= 0);

        // check hosts
        cli.sendLine(":read-children-names(child-type=host)");
        CLIOpResult res = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(res.getResult() instanceof List);
        List  hosts = (List) res.getResult();

        assertTrue(hosts.contains("master"));
        assertTrue(hosts.contains("slave"));

        // check servers
        assertTrue(checkHostServers(cli, "master", new String[] {"main-one", "main-two", "other-one", "reload-one"}));
        assertTrue(checkHostServers(cli, "slave", new String[] {"main-three", "main-four", "other-two", "reload-two"}));
        cli.quit();

    }
View Full Code Here

@RunWith(Arquillian.class)
public class BasicOpsTestCase {

    @Test
    public void testConnect() throws Exception {
        CLIWrapper cli = new CLIWrapper(false);

        // wait for cli welcome message
        String line = cli.readLine(10000);

        while(! line.contains("You are disconnected")) {
            line = cli.readLine(10000);
        }

        cli.sendLine("connect " + TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getServerPort());
        cli.sendLine("version", false);
        line = cli.readLine(5000);
        assertTrue("Connect failed:" + line, line.indexOf("[standalone@") >= 0);

        cli.quit();

    }
View Full Code Here

    }

    @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"));
        assertTrue(ls.contains("core-service"));
        assertTrue(ls.contains("system-property"));
        assertTrue(ls.contains("socket-binding-group"));
        assertTrue(ls.contains("deployment"));
        assertTrue(ls.contains("path"));

        cli.quit();
    }
View Full Code Here

        return ja;
    }
   
    @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());
    }
View Full Code Here

        Assert.assertTrue(cli.hasQuit());
    }

    @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());
    }
View Full Code Here

        Assert.assertTrue(cli.hasQuit());
    }

    @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

        File cliScriptFile = new File(tempDir, "testScript.cli");
        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

        cliScriptFile.delete();
    }
   
    @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

    }   
   
    @Test
    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)});
        cli.sendLine("connect");
        output = cli.readAllUnformated(WAIT_TIMEOUT, WAIT_LINETIMEOUT * 10);
        Assert.assertTrue(output.contains("The controller is not available"));
        cli.quit();       
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.test.integration.management.util.CLIWrapper

Copyright © 2018 www.massapicom. 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.