Package org.jboss.as.cli

Examples of org.jboss.as.cli.CommandContext.buildRequest()


        try {
            ctx.connectController();

            // Add the mod_cluster extension first (not in this profile by default)
            ModelNode request = ctx.buildRequest("/extension=org.jboss.as.modcluster:add");
            ModelNode response = controllerClient.execute(request);
            String outcome = response.get("outcome").asString();
            Assert.assertEquals("Adding mod_cluster extension failed! " + request.toJSONString(false), "success", outcome);

            // Now lets execute subsystem add operation but we need to specify a connector
View Full Code Here


        try {
            ctx.connectController();

            // Test subsystem remove
            ModelNode request = ctx.buildRequest("/subsystem=modcluster:remove");
            ModelNode response = controllerClient.execute(request);
            String outcome = response.get("outcome").asString();
            Assert.assertEquals("Removing mod_cluster subsystem failed! " + request.toJSONString(false), "success", outcome);

            // Cleanup socket binding
View Full Code Here

            ModelNode response = controllerClient.execute(request);
            String outcome = response.get("outcome").asString();
            Assert.assertEquals("Removing mod_cluster subsystem failed! " + request.toJSONString(false), "success", outcome);

            // Cleanup socket binding
            request = ctx.buildRequest("/socket-binding-group=standard-sockets/socket-binding=modcluster:remove");
            response = controllerClient.execute(request);
            outcome = response.get("outcome").asString();
            Assert.assertEquals("Removing socket binding failed! " + request.toJSONString(false), "success", outcome);

            // Cleanup and remove the extension
View Full Code Here

            response = controllerClient.execute(request);
            outcome = response.get("outcome").asString();
            Assert.assertEquals("Removing socket binding failed! " + request.toJSONString(false), "success", outcome);

            // Cleanup and remove the extension
            request = ctx.buildRequest("/extension=org.jboss.as.modcluster:remove");
            response = controllerClient.execute(request);
            outcome = response.get("outcome").asString();
            Assert.assertEquals("Removing mod_cluster extension failed! " + request.toJSONString(false), "success", outcome);
        } finally {
            ctx.terminateSession();
View Full Code Here

            try {
                if (isBatch()) {
                    final CompositeOperationBuilder builder = CompositeOperationBuilder.create();
                    for (String cmd : getCommands()) {
                        try {
                            builder.addStep(ctx.buildRequest(cmd));
                        } catch (CommandFormatException e) {
                            throw new IllegalArgumentException(String.format("Command '%s' is invalid", cmd), e);
                        }
                    }
                    final ModelNode result = client.execute(builder.build());
View Full Code Here

                    }
                } else {
                    for (String cmd : getCommands()) {
                        final ModelNode result;
                        try {
                            result = client.execute(ctx.buildRequest(cmd));
                        } catch (CommandFormatException e) {
                            throw new IllegalArgumentException(String.format("Command '%s' is invalid", cmd), e);
                        }
                        if (!Operations.successful(result)) {
                            throw new IllegalArgumentException(String.format("Command '%s' was unsuccessful. Reason: %s", cmd, Operations.getFailureDescription(result)));
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.