Package com.volantis.xml.pipeline.sax.config

Examples of com.volantis.xml.pipeline.sax.config.XMLPipelineConfiguration


    }

    public static DynamicProcessConfiguration getDynamicConfiguration(
            XMLPipelineContext context) {

        XMLPipelineConfiguration configuration =
                context.getPipelineConfiguration();

        return getDynamicConfiguration(configuration);

    }
View Full Code Here


        // get hold of the pipeline context
        XMLPipelineContext context = getPipelineContext();

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

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

        if (configuration == null) {
            // cannot get hold of the configuration. As this is fatal
            // deliver a fatal error down the pipeline
View Full Code Here

     *
     * @param context The context from which the manager is to be retrieved.
     */
    public static URLContentManager retrieve(XMLPipelineContext context) {

        XMLPipelineConfiguration configuration =
                context.getPipelineConfiguration();
        PipelineURLContentManager manager;

        // Synchronize on the configuration to ensure that if a manager is
        // created then it is updated atomically.
        synchronized(configuration) {
            manager = (PipelineURLContentManager)
                    configuration.retrieveConfiguration(MANAGER_KEY);
            if (manager == null) {
                manager = createManager(configuration);

                configuration.storeConfiguration(MANAGER_KEY, manager);
            }
        }

        return manager;
    }
View Full Code Here

     * {@link ForEachRule} in the pipeline configuration.
     *
     * @return The newly created pipeline configuration.
     */
    protected XMLPipelineConfiguration createPipelineConfiguration() {
        XMLPipelineConfiguration config = super.createPipelineConfiguration();

        DynamicProcessConfiguration dynamicConfig =
                (DynamicProcessConfiguration)
                config.retrieveConfiguration(DynamicProcessConfiguration.class);

        NamespaceRuleSet namespaceRules =
                dynamicConfig.getNamespaceRules(
                        Namespace.PIPELINE.getURI(),
                        true);
View Full Code Here

        WebDriverAccessor accessor = createWebDriverAccessor(
                new WebDriverRequestImpl(), new WebDriverResponseImpl());
        XMLPipelineContext context = process.getPipelineContext();
        context.setProperty(WebDriverAccessor.class, accessor, false);

        XMLPipelineConfiguration pipelineConfig =
                context.getPipelineConfiguration();
        WebDriverConfiguration config = (WebDriverConfiguration)pipelineConfig.
                retrieveConfiguration(WebDriverConfiguration.class);
        config.setIgnoreContentEnabled(true);

        ByteArrayInputStream is =
                new ByteArrayInputStream(inputText.getBytes());
View Full Code Here

        WebDriverAccessor accessor = createWebDriverAccessor(
                new WebDriverRequestImpl(), new WebDriverResponseImpl());
        XMLPipelineContext context = process.getPipelineContext();
        context.setProperty(WebDriverAccessor.class, accessor, false);

        XMLPipelineConfiguration pipelineConfig =
                context.getPipelineConfiguration();
        WebDriverConfiguration config = (WebDriverConfiguration)pipelineConfig.
                retrieveConfiguration(WebDriverConfiguration.class);
        pipelineConfig.storeConfiguration(DynamicProcessConfiguration.class,
                new MockDynamicProcessConfiguration());

        // Set the configuration:
        // ignoreContentEnabled = true
        // responseContaintsPipelineMarkup = false
View Full Code Here

    public void testShouldIgnoreContent() throws Exception {
        HTTPRequestOperationProcess process = (HTTPRequestOperationProcess)
                createTestableProcess();

        XMLPipelineContext context = process.getPipelineContext();
        XMLPipelineConfiguration pipelineConfig =
                context.getPipelineConfiguration();

        WebDriverConfiguration config = (WebDriverConfiguration)pipelineConfig.
                retrieveConfiguration(WebDriverConfiguration.class);

        // Config ignore = true
        // process ignore = not set
        boolean ignore = process.shouldIgnoreContent(200);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(300);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(399);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(404);
        assertTrue("Should ignore content.", ignore);
        ignore = process.shouldIgnoreContent(304);
        assertTrue("Should ignore content.", ignore);

        // config ignore = false
        // process ignore = not set
        config.setIgnoreErroredContent(false);
        ignore = process.shouldIgnoreContent(200);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(300);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(399);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(404);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(304);
        assertTrue("Should ignore content.", ignore);

        // config ignore = false
        // process ignore = true
        process.setIgnoreErroredContent("true");
        ignore = process.shouldIgnoreContent(200);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(300);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(399);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(404);
        assertTrue("Should ignore content.", ignore);
        ignore = process.shouldIgnoreContent(304);
        assertTrue("Should ignore content.", ignore);

        // config ignore = true
        // process ignore = true
        config.setIgnoreErroredContent(true);
        ignore = process.shouldIgnoreContent(200);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(300);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(399);
        assertFalse("Should not ignore content.", ignore);
        ignore = process.shouldIgnoreContent(404);
        assertTrue("Should ignore content.", ignore);
        ignore = process.shouldIgnoreContent(304);
        assertTrue("Should ignore content.", ignore);

        process = (HTTPRequestOperationProcess) createTestableProcess();
        context = process.getPipelineContext();
        pipelineConfig = context.getPipelineConfiguration();
        config = (WebDriverConfiguration)pipelineConfig.
                retrieveConfiguration(WebDriverConfiguration.class);

        process.setIgnoreErroredContent("false");
        // config ignore = true
        // process ignore = false
View Full Code Here

                new WebDriverRequestImpl(), new WebDriverResponseImpl());
        XMLPipelineContext context = process.getPipelineContext();
        context.setProperty(WebDriverAccessor.class, accessor, false);

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

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

        final XMLFilterImpl xmlFilter = new XMLFilterImpl();
        final XMLResponseConditioner xmlConditioner =
                new XMLResponseConditioner(xmlFilter);
View Full Code Here

*/
public class HTTPWebDriverTestCase extends WebDriverTestAbstract {

    // JavaDoc inherited
    protected XMLPipelineConfiguration createPipelineConfiguration() {
        XMLPipelineConfiguration config = super.createPipelineConfiguration();
        WebDriverConfigurationImpl webdConf = new WebDriverConfigurationImpl() {
            // javadoc inherited
            PluggableHTTPManager getPluggableHTTPManager(String protocol) {
                return new HTTPClientPluggableHTTPManager();
            }
            // javadoc inherited
            public void setTimeout(long timeout) {
            }
            // javadoc inherited
            public long getTimeoutInMillis() {
                return -1;
            }
        };
        config.storeConfiguration(WebDriverConfiguration.class, webdConf);
        return config;
    }
View Full Code Here

        } else {
            // get hold of the pipeline context
            XMLPipelineContext context = dynamicProcess.getPipelineContext();

            // 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 =
                            (ConnectionConfiguration) pipelineConfiguration.
                            retrieveConfiguration(
                                    ConnectionConfiguration.class);

                    if ((connectionConfiguration != null) &&
                            (connectionConfiguration.getTimeout() > 0)) {
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.config.XMLPipelineConfiguration

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.