Package com.volantis.xml.pipeline.sax.drivers.web

Examples of com.volantis.xml.pipeline.sax.drivers.web.WebDriverConfiguration


        final int maxEntries;
        if (connectionConfig != null) {
            enabled = connectionConfig.isCachingEnabled();
            maxEntries = connectionConfig.getMaxCacheEntries();
        } else {
            final WebDriverConfiguration webDriverConfig =
                (WebDriverConfiguration) pipelineConfig.retrieveConfiguration(
                    WebDriverConfiguration.class);
            if (webDriverConfig != null) {
                final HTTPCacheConfiguration httpCacheConfig =
                    webDriverConfig.getHTTPCacheConfiguration();
                if (httpCacheConfig != null) {
                    enabled = true;
                    maxEntries = httpCacheConfig.getMaxEntries();
                } else {
                    enabled = false;
View Full Code Here


            // get hold of the pipeline configuration
            XMLPipelineConfiguration pipelineConfiguration =
                    context.getPipelineConfiguration();

            WebDriverConfiguration configuration = (WebDriverConfiguration)
                    pipelineConfiguration.retrieveConfiguration(
                            WebDriverConfiguration.class);

            if (configuration == null) {
                // cannot get hold of the configuration. As this is fatal
                // deliver a fatal error down the pipeline
                SAXParseException exception = forwardFatalError(dynamicProcess,
                        "Could not retrieve the Web Driver configuration");
                throw exception;

            } else {
                long timeoutInMillis = -1;
                if (configuration.timeoutWasSet()) {
                    timeoutInMillis = configuration.getTimeoutInMillis();
                } else {
                    // There is no configured timeout, so let's take the one,
                    // if any, specified in the generic connection timeout
                    // (remembering to convert from seconds to milliseconds).
                    ConnectionConfiguration connectionConfiguration =
View Full Code Here

            new TestXmlConfigurationBuilder(input);

        MarinerConfiguration actualConfig = configBuilder.buildConfiguration();
        assertNotNull(actualConfig);

        final WebDriverConfiguration config =
            actualConfig.getPipelineConfiguration().getWebDriverConfiguration();


        if (mock != null) {
            assertNotNull("Actual configuration should not be null",
View Full Code Here

     * process will require for testing
     * @return a WebDriverConfiguration instance
     */
    public WebDriverConfiguration createWebDriverConfiguration() {
        // create a configuration
        WebDriverConfiguration config = new WebDriverConfigurationImpl();

        // create a proxy
        DefaultProxy proxy = new DefaultProxy();
        proxy.setId("proxyRef");
        proxy.setPort(8080);
        proxy.setHost("volantis");
        config.putProxy(proxy);

        // create a script module
        SimpleScriptModule script = new SimpleScriptModule();
        script.setId("scriptRef");
        config.putScriptModule(script);

        // return the configuration
        return config;
    }
View Full Code Here

                }
                }

            // Create the web driver configuration - this information
            // comes from mcs-config.xml in normal MCS operation.
            WebDriverConfiguration webdConfig =
                createWebDriverConfig();
           
            // set encoding if available
            // ported from 4.2.0, see vbm 2007070313
            if (marinerRequestContext != null) {
                webdConfig.setCharacterEncoding(
                        marinerRequestContext.getCharacterEncoding());
            }

            // Create a pipeline configuration which knows about the web
            // driver configuration that we've specified, and the default
            // MCS dynamic pipeline configuration.
            XMLPipelineConfiguration configuration =
                    createPipelineConfiguration(webdConfig);

            final XMLPipelineContext pipelineContext =
                    createPipelineContext(configuration,
                            httpRequest, httpResponse);

            setUpJSessionPreprocessors(pipelineContext, httpRequest,
                                       remoteProjectName);

            storeRemoteProject(pipelineContext, remoteProjectName);

            // Push the URL of the resource that we need to retrieve onto
            // the context - this allows relative references in any
            // returned markup to be resolved.
            pipelineContext.pushBaseURI(remappedURL);

                // Create a pipeline
                XMLPipeline pipeline = pipelineFactory.createPipeline
                    (pipelineContext);
            XMLFilter filter = pipelineFactory.createPipelineFilter(
                    pipeline, true);

            // Create a serializer that will output to the response.
            ServletOutputStream outputStream = httpResponse.getOutputStream();
            XMLSerializer serializer = getSerializer(outputStream);
            filter.setContentHandler(serializer.asContentHandler());

            // Create and initialise the request process.
            HTTPRequestOperationProcess requestOperation =
                    new HTTPRequestOperationProcess();
            requestOperation.setFollowRedirects(
                    Boolean.toString(webdConfig.getFollowRedirects()));
            requestOperation.setUrlString(remappedURL);
            requestOperation.setRequestType(HTTPRequestType.GET);
            // todo this is wrong as the request operation timeout is in
            // todo seconds but the configuration is in milliseconds.
            Period timeout = Period.treatNonPositiveAsIndefinitely(
                    webdConfig.getTimeoutInMillis());
            requestOperation.setTimeout(timeout);

            // This is necessary in order for the request process to be
            // able to pick up the headers, parameters, cookies etc.
            WebDriverAccessor webdAccessor = createWebDriverAccessor(
View Full Code Here

                : new WSDriverConfiguration();

        pipelineConfig.storeConfiguration(WSDriverConfiguration.class,
                wsDriverConfiguration);

        WebDriverConfiguration webDriverConfiguration =
                (configFileInfo.getWebDriverConfiguration() != null)
                ? configFileInfo.getWebDriverConfiguration()
                : WebDriverFactory.getDefaultInstance().createConfiguration();
        pipelineConfig.storeConfiguration(WebDriverConfiguration.class,
                webDriverConfiguration);
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.drivers.web.WebDriverConfiguration

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.