Package org.jboss.as.cli

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


    public void testDeployArchive() throws Exception {

        final CommandContext ctx = CLITestUtil.getCommandContext();
        try {
            ctx.connectController();
            ctx.handle("deploy " + cliArchiveFile.getAbsolutePath() + " --script=install.scr");

            // check that now both wars are deployed
            String response = HttpRequest.get(getBaseURL(url) + "deployment0/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            response = HttpRequest.get(getBaseURL(url) + "deployment1/SimpleServlet", 10, TimeUnit.SECONDS);
View Full Code Here


            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            response = HttpRequest.get(getBaseURL(url) + "deployment1/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment2/SimpleServlet"));

            ctx.handle("deploy " + cliArchiveFile.getAbsolutePath() + " --script=uninstall.scr");

            // check that both wars are undeployed
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment0/SimpleServlet"));
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment1/SimpleServlet"));
        } finally {
View Full Code Here

    public void testUnDeployArchive() throws Exception {

        final CommandContext ctx = CLITestUtil.getCommandContext();
        try {
            ctx.connectController();
            ctx.handle("deploy " + cliArchiveFile.getAbsolutePath() + " --script=install.scr");

            // check that now both wars are deployed
            String response = HttpRequest.get(getBaseURL(url) + "deployment0/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            response = HttpRequest.get(getBaseURL(url) + "deployment1/SimpleServlet", 10, TimeUnit.SECONDS);
View Full Code Here

            String response = HttpRequest.get(getBaseURL(url) + "deployment0/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            response = HttpRequest.get(getBaseURL(url) + "deployment1/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);

            ctx.handle("undeploy " + "--path=" + cliArchiveFile.getAbsolutePath() + " --script=uninstall.scr");

            // check that both wars are undeployed
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment0/SimpleServlet"));
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment1/SimpleServlet"));
        } finally {
View Full Code Here

    public void testDeployUndeployArchive() throws Exception {

        final CommandContext ctx = CLITestUtil.getCommandContext();
        try {
            ctx.connectController();
            ctx.handle("deploy " + cliArchiveFile.getAbsolutePath());

            // check that now both wars are deployed
            String response = HttpRequest.get(getBaseURL(url) + "deployment0/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            response = HttpRequest.get(getBaseURL(url) + "deployment1/SimpleServlet", 10, TimeUnit.SECONDS);
View Full Code Here

            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            response = HttpRequest.get(getBaseURL(url) + "deployment1/SimpleServlet", 10, TimeUnit.SECONDS);
            assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >=0);
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment2/SimpleServlet"));

            ctx.handle("undeploy " + "--path=" + cliArchiveFile.getAbsolutePath());

            // check that both wars are undeployed
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment0/SimpleServlet"));
            assertTrue(checkUndeployed(getBaseURL(url) + "deployment1/SimpleServlet"));
        } finally {
View Full Code Here

      }

      try {
        logger.branch(Type.INFO, "Connecting to JBoss AS...");

        ctx.handle("connect localhost:9999");

        logger.log(Type.INFO, "Connected to JBoss AS");
        logger.unbranch();
      } catch (CommandLineException e) {
        logger.branch(Type.ERROR, "Could not connect to AS", e);
View Full Code Here

      }

      try {
        logger.branch(Type.INFO, String.format("Setting AS to listen for http requests on port %d...", port));

        ctx.handle(String.format(
                "/socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=port,value=%d)", port));
        ctx.handle(":reload");
        // Give the server time to reload
        try {
          Thread.sleep(1000);
View Full Code Here

      try {
        logger.branch(Type.INFO, String.format("Setting AS to listen for http requests on port %d...", port));

        ctx.handle(String.format(
                "/socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=port,value=%d)", port));
        ctx.handle(":reload");
        // Give the server time to reload
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e) {
          logger.log(Type.WARN, "Interrupted while waiting for JBoss AS to reload", e);
View Full Code Here

         * scanned and deployed
         */
        logger.branch(Type.INFO,
                String.format("Adding deployment %s at %s...", getAppName(), appRootDir.getAbsolutePath()));

        ctx.handle(String.format("/deployment=%s:add(content=[{\"path\"=>\"%s\",\"archive\"=>false}], enabled=false)",
                getAppName(), appRootDir.getAbsolutePath()));

        logger.log(Type.INFO, "Deployment resource added");
        logger.unbranch();
      } catch (CommandLineException e) {
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.