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

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


    }

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

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

        assertTrue(map.containsKey("operation-name"));
        assertTrue(map.containsKey("description"));
        assertTrue(map.containsKey("request-properties"));
    }
View Full Code Here


    }

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

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

        assertTrue(types.contains("virtual-server"));
        assertTrue(types.contains("connector"));
    }
View Full Code Here

    }

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

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

        assertTrue(names.contains("http"));
    }
View Full Code Here

    }

    @Test
    public void testReadChildrenResources() throws Exception {
        cli.sendLine("/subsystem=web:read-children-resources(child-type=connector)");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);

        assertTrue(result.isIsOutcomeSuccess());
        assertTrue(result.getResult() instanceof Map);
        Map res = (Map) result.getResult();
        assertTrue(res.get("http") instanceof Map);
        Map http = (Map) res.get("http");
        assertTrue(http.containsKey("enabled"));

    }
View Full Code Here

    @Test
    public void testAddRemoveOperation() throws Exception {

        // add new connector
        cli.sendLine("/socket-binding-group=standard-sockets/socket-binding=test:add(port=8181)");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());

        cli.sendLine("/subsystem=web/connector=test-connector:add(socket-binding=test, scheme=http, protocol=\"HTTP/1.1\", enabled=true)");
        result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());

        // check that the connector is live
        String cURL = "http://" + url.getHost() + ":8181";

        String response = HttpRequest.get(cURL, 10, TimeUnit.SECONDS);
        assertTrue("Invalid response: " + response, response.indexOf("JBoss") >=0);


        // remove connector
        cli.sendLine("/subsystem=web/connector=test-connector:remove");
        result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());

        cli.sendLine("/socket-binding-group=standard-sockets/socket-binding=test:remove");
        result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());

        // check that the connector is no longer live
        Thread.sleep(5000);
        boolean failed = false;
        try {
View Full Code Here

    private void removeDeploymentScanner() throws Exception {

        // remove deployment scanner
        cli.sendLine("/subsystem=deployment-scanner/scanner=testScanner:remove()", false);
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.isIsOutcomeSuccess());

        // delete deployment
        assertTrue("Could not delete deployed file.", warFile.delete());

        // wait for deployment
View Full Code Here

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

        // check that datasource was modified
        cli.sendLine("/subsystem=datasources/data-source=TestDS:read-resource(recursive=true)");
        CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        assertTrue(result.getResult().toString(), 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("/subsystem=datasources/xa-data-source=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

        // test deployment scanner remove command
        cli.sendLine("deployment-scanner remove --name=testScanner");
       
        // check that the scanner was removed
        cli.sendLine("/subsystem=deployment-scanner/scanner=testScanner:read-resource");
        CLIOpResult res = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
        Assert.assertFalse("Deployment scanner not removed.", res.isIsOutcomeSuccess());
       
        // undeploy test war
        cli.sendLine("undeploy SimpleServlet.war", true);
        Assert.assertTrue(checkUndeployed(getBaseURL(url) + "SimpleServlet/SimpleServlet"));       
       
View Full Code Here


    @Test
    public void addMissingPassword() throws IOException {
        cli.sendLine("/subsystem=security/security-domain=empty-jsse-missing-pwd/jsse=classic:add(server-alias=silent.planet,keystore={type=JKS})", true);
        CLIOpResult result = cli.readAllAsOpResult();
        assertThat(result, is(notNullValue()));
        assertThat(result.getFromResponse(OUTCOME).toString(), is("failed"));
    }
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.