Package org.apache.cactus.integration.ant.container

Examples of org.apache.cactus.integration.ant.container.ContainerRunner


     */
    private void executeInContainer(Container theContainer,
        DeployableFile theFile)
    {
        log("Starting up container", Project.MSG_VERBOSE);
        ContainerRunner runner = new ContainerRunner(theContainer);
        runner.setLog(new AntLog(this));
        try
        {
            URL url = new URL(theContainer.getBaseURL() + "/"
                + theFile.getTestContext()
                + theFile.getServletRedirectorMapping()
                + "?Cactus_Service=RUN_TEST");
            runner.setURL(url);
            if (this.containerSet.getTimeout() > 0)
            {
                runner.setTimeout(this.containerSet.getTimeout());
            }
            runner.startUpContainer();
            log("Server name retrieved from 'Server' HTTP header: ["
                + runner.getServerName() + "]", Project.MSG_VERBOSE);
            try
            {
                Enumeration tests = getIndividualTests();
                while (tests.hasMoreElements())
                {
                    JUnitTest test = (JUnitTest) tests.nextElement();
                    if (test.shouldRun(getProject())
                     && !theContainer.isExcluded(test.getName()))
                    {
                        if (theContainer.getToDir() != null)
                        {
                            test.setTodir(theContainer.getToDir());
                        }
                        execute(test);
                    }
                }
            }
            finally
            {
                log("Shutting down container", Project.MSG_VERBOSE);
                runner.shutDownContainer();
                log("Container shut down", Project.MSG_VERBOSE);
            }
        }
        catch (MalformedURLException mue)
        {
View Full Code Here


        }

        this.container.setAntTaskFactory(new DefaultAntTaskFactory(
            getProject(), getTaskName(), getLocation(), getOwningTarget()));

        ContainerRunner runner = new ContainerRunner(this.container);
        runner.setLog(new AntLog(this));
        runner.setURL(this.testURL);
        runner.setTimeout(this.timeout);
        runner.startUpContainer();
        try
        {
            this.testHook.execute();
        }
        finally
        {
            runner.shutDownContainer();
        }
    }
View Full Code Here

                "The [testurl] attribute must be specified");
        }

        this.container.setAntTaskFactory(antTaskFactory);

        ContainerRunner runner = new ContainerRunner(this.container);
        runner.setLog(new AntLog(this));
        runner.setUrl(this.testUrl);
        runner.setTimeout(this.timeout);
        runner.startUpContainer();
        try
        {
            this.testHook.execute();
        }
        finally
        {
            runner.shutDownContainer();
        }
    }
View Full Code Here

     */
    private void executeInContainer(Container theContainer,
        DeployableFile theFile)
    {
        log("Starting up container", Project.MSG_VERBOSE);
        ContainerRunner runner = new ContainerRunner(theContainer);
        runner.setLog(new AntLog(this));
        try
        {
            URL url =
                new URL("http", "localhost", theContainer.getPort(), "/"
                + theFile.getTestContext()
                + theFile.getServletRedirectorMapping()
                + "?Cactus_Service=RUN_TEST");
            runner.setUrl(url);
            if (this.containerSet.getTimeout() > 0)
            {
                runner.setTimeout(this.containerSet.getTimeout());
            }
            runner.startUpContainer();
            log("Container responding to HTTP requests as "
                + runner.getServerName(), Project.MSG_VERBOSE);
            try
            {
                Enumeration tests = getIndividualTests();
                while (tests.hasMoreElements())
                {
                    JUnitTest test = (JUnitTest) tests.nextElement();
                    if (test.shouldRun(getProject())
                     && !theContainer.isExcluded(test.getName()))
                    {
                        if (theContainer.getToDir() != null)
                        {
                            test.setTodir(theContainer.getToDir());
                        }
                        execute(test);
                    }
                }
            }
            finally
            {
                log("Shutting down container", Project.MSG_VERBOSE);
                runner.shutDownContainer();
                log("Container shut down", Project.MSG_VERBOSE);
            }
        }
        catch (MalformedURLException mue)
        {
View Full Code Here

     */
    private void executeInContainer(Container theContainer, WarArchive theWar,
        String theContextPath)
    {
        log("Starting up container", Project.MSG_VERBOSE);
        ContainerRunner runner = new ContainerRunner(theContainer);
        runner.setLog(new AntLog(this));
        try
        {
            URL url =
                new URL("http", "localhost", theContainer.getPort(), "/"
                + theContextPath + getServletRedirectorMapping(theWar)
                + "?Cactus_Service=RUN_TEST");
            runner.setUrl(url);
            if (this.containerSet.getTimeout() > 0)
            {
                runner.setTimeout(this.containerSet.getTimeout());
            }
            runner.startUpContainer();
            log("Container responding to HTTP requests as "
                + runner.getServerName(), Project.MSG_VERBOSE);
            try
            {
                Enumeration tests = getIndividualTests();
                while (tests.hasMoreElements())
                {
                    JUnitTest test = (JUnitTest) tests.nextElement();
                    if (test.shouldRun(getProject())
                     && !theContainer.isExcluded(test.getName()))
                    {
                        if (theContainer.getToDir() != null)
                        {
                            test.setTodir(theContainer.getToDir());
                        }
                        execute(test);
                    }
                }
            }
            finally
            {
                log("Shutting down container", Project.MSG_VERBOSE);
                runner.shutDownContainer();
                log("Container shut down", Project.MSG_VERBOSE);
            }
        }
        catch (MalformedURLException mue)
        {
View Full Code Here

     */
    private void executeInContainer(Container theContainer,
        DeployableFile theFile)
    {
        log("Starting up container", Project.MSG_VERBOSE);
        ContainerRunner runner = new ContainerRunner(theContainer);
        runner.setLog(new AntLog(this));
        try
        {
            URL url =
                new URL("http", "localhost", theContainer.getPort(), "/"
                + theFile.getTestContext()
                + theFile.getServletRedirectorMapping()
                + "?Cactus_Service=RUN_TEST");
            runner.setUrl(url);
            if (this.containerSet.getTimeout() > 0)
            {
                runner.setTimeout(this.containerSet.getTimeout());
            }
            runner.startUpContainer();
            log("Container responding to HTTP requests as "
                + runner.getServerName(), Project.MSG_VERBOSE);
            try
            {
                Enumeration tests = getIndividualTests();
                while (tests.hasMoreElements())
                {
                    JUnitTest test = (JUnitTest) tests.nextElement();
                    if (test.shouldRun(getProject())
                     && !theContainer.isExcluded(test.getName()))
                    {
                        if (theContainer.getToDir() != null)
                        {
                            test.setTodir(theContainer.getToDir());
                        }
                        execute(test);
                    }
                }
            }
            finally
            {
                log("Shutting down container", Project.MSG_VERBOSE);
                runner.shutDownContainer();
                log("Container shut down", Project.MSG_VERBOSE);
            }
        }
        catch (MalformedURLException mue)
        {
View Full Code Here

                "The [testurl] attribute must be specified");
        }

        this.container.setAntTaskFactory(antTaskFactory);

        ContainerRunner runner = new ContainerRunner(this.container);
        runner.setLog(new AntLog(this));
        runner.setUrl(this.testUrl);
        runner.setTimeout(this.timeout);
        runner.startUpContainer();
        try
        {
            this.testHook.execute();
        }
        finally
        {
            runner.shutDownContainer();
        }
    }
View Full Code Here

    private void executeInContainer(ContainerWrapper theWrapper,
        DeployableFile theFile)
    {
      super.init();
        log("Starting up container", Project.MSG_VERBOSE);
        ContainerRunner runner = new ContainerRunner(theWrapper);
        runner.setLogger(new AntLogger(getProject()));
        try
        {
            URL url = new URL(theWrapper.getBaseURL() + "/"
                + theFile.getTestContext()
                + theFile.getServletRedirectorMapping()
                + "?Cactus_Service=RUN_TEST");
            runner.setURL(url);
        
            runner.startUpContainer();
            log("Server name retrieved from 'Server' HTTP header: ["
                + runner.getServerName() + "]", Project.MSG_VERBOSE);
            try
            {
                Enumeration tests = getIndividualTests();
                while (tests.hasMoreElements())
                {
                    JUnitTest test = (JUnitTest) tests.nextElement();
                    if (test.shouldRun(getProject())
                     && !theWrapper.isExcluded(test.getName()))
                    {
                      test.setFork(true);
                        if (theWrapper.getToDir() != null)
                        {
                            test.setTodir(theWrapper.getToDir());
                        }
                        execute(test);
                    }
                }
            }
            finally
            {
                log("Shutting down container", Project.MSG_VERBOSE);
                runner.shutDownContainer();
                log("Container shut down", Project.MSG_VERBOSE);
            }
        }
        catch (MalformedURLException mue)
        {
View Full Code Here

        }

        this.container.setAntTaskFactory(new DefaultAntTaskFactory(
                getProject(), getTaskName(),
                getLocation(), getOwningTarget()));
        ContainerRunner runner = new ContainerRunner(this.container);
        runner.setLogger(new AntLogger(getProject()));
        runner.setURL(this.testURL);
        runner.setTimeout(this.timeout);
        runner.startUpContainer();
        try
        {
            this.testHook.execute();
        }
        finally
        {
            runner.shutDownContainer();
        }
    }
View Full Code Here

        // is started. In that case, this task will only return when the
        // container is up and running. If no test URL has been started
        // we simply start the container and give back the control to the user
        // without waiting for container to be up and running.
       
        ContainerRunner runner = null;
        if (getTestURL() != null)
        {
            runner = new ContainerRunner(container);
            runner.setURL(getTestURL());
        }
       
        // Decide whether to start or stop the container
        if (getAction().equalsIgnoreCase("start"))
        {
            if (getTestURL() != null)
            {
                runner.startUpContainer();
            }
            else
            {
                container.startUp();
            }
        }
        else if (getAction().equalsIgnoreCase("stop"))
        {
            if (getTestURL() != null)
            {
                runner.shutDownContainer();
            }
            else
            {
                container.shutDown();
            }
View Full Code Here

TOP

Related Classes of org.apache.cactus.integration.ant.container.ContainerRunner

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.