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

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


    }

    @Test
    public void addValid() throws Exception {
        cli.sendLine("/subsystem=security/security-domain=empty-jsse-valid/jsse=classic:add(server-alias=silent.planet)");
        CLIOpResult result = cli.readAllAsOpResult();
        assertThat(result, is(notNullValue()));
        assertThat(result.getFromResponse(OUTCOME).toString(), is("success"));
    }
View Full Code Here


    }

    @Test
    public void addEmpty() throws Exception {
        cli.sendLine("/subsystem=security/security-domain=empty-jsse/jsse=classic:add()");
        CLIOpResult result = cli.readAllAsOpResult();
        assertThat(result, is(notNullValue()));
        assertThat(result.getFromResponse(OUTCOME).toString(), is("success"));
    }
View Full Code Here

            // add data source
            cli.sendLine("data-source add --name=ObjectStoreTestDS --jndi-name=java:jboss/datasources/ObjectStoreTestDS --driver-name=h2 --connection-url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 --jta=false");

            cli.sendLine("/subsystem=transactions:write-attribute(name=jdbc-store-datasource, value=java:jboss/datasources/ObjectStoreTestDS)");
            cli.sendLine("/subsystem=transactions:write-attribute(name=use-jdbc-store, value=true)");
            final CLIOpResult ret = cli.readAllAsOpResult();
            assertEquals("reload-required", (String) ((Map) ret.getFromResponse(RESPONSE_HEADERS)).get(PROCESS_STATE));

            cli.sendLine("reload");

            objectStoreType = readObjectStoreType();
            assertEquals("jdbc", objectStoreType);
View Full Code Here

        }
    }

    private String readObjectStoreType() throws IOException, MgmtOperationException {
        cli.sendLine("/subsystem=transactions/log-store=log-store:read-attribute(name=type)");
        final CLIOpResult res = cli.readAllAsOpResult();
        return (String) res.getResult();
    }
View Full Code Here

        try {
            String objectStoreType = readObjectStoreType();
            assertEquals("default", objectStoreType);

            cli.sendLine("/subsystem=transactions:write-attribute(name=use-hornetq-store, value=true)");
            final CLIOpResult ret = cli.readAllAsOpResult();
            assertEquals("reload-required", (String) ((Map) ret.getFromResponse(RESPONSE_HEADERS)).get(PROCESS_STATE));

            cli.sendLine("reload");

            objectStoreType = readObjectStoreType();
            assertEquals("hornetq", objectStoreType);
View Full Code Here

        String rolloutPlan = planBuilder.buildAsString();
        cli.sendLine("rollout-plan add --name=maxFailPercPlan --content=" + rolloutPlan);

        // 1st scenario - server-one should fail, but the whole operation should succeed
        checkURL("main-one", false, "/RolloutPlanTestCase/RolloutServlet?operation=bind&bindPort=" + TEST_PORT);
        CLIOpResult ret = testAddConnector("maxFailPercPlan");
        Assert.assertTrue(ret.isIsOutcomeSuccess());
        Assert.assertFalse(getServerStatus("main-one", ret));
        Assert.assertTrue(getServerStatus("main-two", ret));
        Assert.assertTrue(getServerStatus("main-three", ret));
        Assert.assertTrue(getServerStatus("test-one", ret));
        ret = testRemoveConnector("maxFailPercPlan");
        Assert.assertTrue(ret.isIsOutcomeSuccess());
        Assert.assertFalse(getServerStatus("main-one", ret));
        Assert.assertTrue(getServerStatus("main-two", ret));
        Assert.assertTrue(getServerStatus("main-three", ret));
        Assert.assertTrue(getServerStatus("test-one", ret));

        // 2nd scenario - main-one and main-three should fail -> main-two should be rolled back but the operation succeed
        checkURL("main-three", false, "/RolloutPlanTestCase/RolloutServlet?operation=bind&bindPort=" +
                String.valueOf(TEST_PORT + CLITestSuite.portOffsets.get("main-three")));
        ret = testAddConnector("maxFailPercPlan");
        Assert.assertTrue(ret.isIsOutcomeSuccess());
        Assert.assertFalse(getServerStatus("main-one", ret));
        Assert.assertFalse(getServerStatus("main-two", ret));
        Assert.assertFalse(getServerStatus("main-three", ret));
        Assert.assertTrue(getServerStatus("test-one", ret));
View Full Code Here

        // let the helper server bind to test port to prevent successful subsequent add connector operation on main-one
        checkURL("main-one", false, "/RolloutPlanTestCase/RolloutServlet?operation=bind&bindPort=" + TEST_PORT);
        checkURL("main-three", false, "/RolloutPlanTestCase/RolloutServlet?operation=bind&bindPort=" +
                String.valueOf(TEST_PORT + CLITestSuite.portOffsets.get("main-three")));
        CLIOpResult ret = testAddConnector("groupsRollbackPlan");
        Assert.assertFalse(ret.isIsOutcomeSuccess());
        Assert.assertFalse(getServerStatus("main-one", ret));
        Assert.assertFalse(getServerStatus("main-two", ret));
        Assert.assertFalse(getServerStatus("main-three", ret));
        Assert.assertFalse(getServerStatus("test-one", ret));
View Full Code Here

                "{rollout id=" + rolloutPlanId + "; allow-resource-service-restart=true}");
        return cli.readAllAsOpResult();
    }

    private void testCleanupConnector(String rolloutPlanId) throws Exception {
        CLIOpResult ret = testRemoveConnector(rolloutPlanId);
        Assert.assertTrue(ret.isIsOutcomeSuccess());
        Assert.assertTrue(getServerStatus("test-one", ret));
        boolean gotNoResponse = false;
        for (String server : new String[]{"main-one", "main-two", "main-three"}) {
            try {
                Assert.assertFalse(getServerStatus(server, ret));
View Full Code Here

        final String serverHost = CLITestSuite.getServerHost(serverName);
        RetryTaskExecutor<Void> taskExecutor = new RetryTaskExecutor<Void>();
        taskExecutor.retryTask(new Callable<Void>() {
            public Void call() throws Exception {
                cli.sendLine("/host=" + serverHost + "/server-config=" + serverName + ":read-attribute(name=status)");
                CLIOpResult res = cli.readAllAsOpResult();
                if (! res.getResult().equals(state)) throw new Exception("Server not in state.");
                return null;
            }
        });

    }
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();
        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

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.