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

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


       
        // If the startlevel is not defined the subsystem is down
        // [TODO] define a more explicit runtime atttribute
        if ("undefined".equals(startLevel)) {
            cli.sendLine("/subsystem=osgi:activate");
            CLIOpResult cliresult = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
            assertTrue(cliresult.isIsOutcomeSuccess());
            assertEquals("1", getFrameworkStartLevel());
        } else if ("1".equals(startLevel)) {
            // Nothing to do           
        } else {
            fail("Unexpected startlevel: " + startLevel);
View Full Code Here


    // [TODO] any other management operations that need testing?

    private String getFrameworkStartLevel() throws Exception {
        cli.sendLine("/subsystem=osgi:read-attribute(name=startlevel)");
        CLIOpResult cliresult = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);

        assertTrue(cliresult.isIsOutcomeSuccess());
        return (String)cliresult.getResult();
    }
View Full Code Here

        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
View Full Code Here

    }

    private boolean checkHostServers(CLIWrapper cli, String host, String[] serverList) throws Exception {
        cli.sendLine("/host=" + host + ":read-children-names(child-type=server-config)");
        CLIOpResult res = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(res.getResult() instanceof List);
        List  servers = (List) res.getResult();

        if (servers.size() != serverList.length) return false;
        for (String server : serverList) if (!servers.contains(server)) return false;

        return true;
View Full Code Here

        }
        cli.sendLine(cmd.toString());

        // check that datasource was modified
        cli.sendLine("/profile=" + profileNames[0] + "/subsystem=datasources/data-source=java\\:jboss\\/datasources\\/TestDS:read-resource(recursive=true)");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult() instanceof Map);
        Map dsProps = (Map) result.getResult();
        for (String[] props : DS_PROPS) assertTrue(dsProps.get(props[0]).equals(props[1]));

    }
View Full Code Here

        }
        cli.sendLine(cmd.toString());

        // check that datasource was modified
        cli.sendLine("/profile=" + profileNames[0] + "/subsystem=datasources/xa-data-source=java\\:jboss\\/datasources\\/TestXADS:read-resource(recursive=true)");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult() instanceof Map);
        Map dsProps = (Map) result.getResult();
        for (String[] props : DS_PROPS) assertTrue(dsProps.get(props[0]).equals(props[1]));

    }
View Full Code Here

        testReadResource(true);
    }

    private void testReadResource(boolean recursive) throws Exception {
        cli.sendLine("/subsystem=web:read-resource(recursive="+ String.valueOf(recursive) +")");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);

        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult() instanceof Map);
        Map map = (Map) result.getResult();

        assertTrue(map.get("virtual-server") instanceof Map);

        Map vServer = (Map) map.get("virtual-server");
        assertTrue(vServer.containsKey("default-host"));
View Full Code Here

    }

    @Test
    public void testReadAttribute() throws Exception {
        cli.sendLine("/subsystem=web:read-attribute(name=native)");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);

        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult().equals("true") || result.getResult().equals("false"));

    }
View Full Code Here

    }

    @Test
    public void testReadResourceDescription() throws Exception {
        cli.sendLine("/subsystem=web:read-resource-description");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);

        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult() instanceof Map);
        Map map = (Map) result.getResult();

        assertTrue(map.containsKey("description"));
        assertTrue(map.containsKey("attributes"));
    }
View Full Code Here

    }

    @Test
    public void testReadOperationNames() throws Exception {
        cli.sendLine("/subsystem=web:read-operation-names");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);

        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult() instanceof List);
        List names = (List) result.getResult();

        assertTrue(names.contains("read-attribute"));
        assertTrue(names.contains("read-children-names"));
        assertTrue(names.contains("read-children-resources"));
        assertTrue(names.contains("read-children-types"));
View Full Code Here

TOP

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

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.