Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLPipelineContext


            DynamicProcess dynamicProcess, ExpandedName element,
            Attributes attributes) throws SAXException {

        String ref = attributes.getValue("ref");
        if (ref != null) {
            XMLPipelineContext context = dynamicProcess.getPipelineContext();
            Script script = new Script(ref);
            context.setProperty(Script.class, script, false);
        } else {
            forwardError(dynamicProcess,
                    "Script tag should have the 'ref' parameter set. " +
                    "Value is: ref='" + ref + "'");
        }
View Full Code Here


    public void testRetrieveContentAction() throws Throwable {

        HTTPRequestOperationProcess process = (HTTPRequestOperationProcess)
                createTestableProcess();

        XMLPipelineContext context = process.getPipelineContext();

        // Testing empty map
        String contentType = "text/html; charset=\"utf-8\"";

        String method = "retrieveContentAction";

        Class paramTypes [] = {String.class};
        Object args [] = {contentType};

        testConsume(process, method, paramTypes, args);

        // Testing empty map with null content type
        args[0] = null;

        testIgnore(process, method, paramTypes, args);

        // Testing non-empty map with all ignores and item in the map
        Map map = new HashMap();

        args[0] = contentType;
        map.put("text/html", new Content("text/html", ContentAction.IGNORE));
        context.setProperty(Content.class, map, false);

        testIgnore(process, method, paramTypes, args);

        // Testing non-empty map with all ignores and item not in the map
        args[0] = "image/gif";
View Full Code Here

        SAXHandler handler = new SAXHandler();
        XMLProcess consumer = XMLHelpers.createSAXHandlerProcess(handler);

        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 =
View Full Code Here

        SAXHandler handler = new SAXHandler();
        XMLProcess consumer = XMLHelpers.createSAXHandlerProcess(handler);

        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());
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
View Full Code Here

        HTTPRequestOperationProcess process = (HTTPRequestOperationProcess)
                createTestableProcess();

        WebDriverAccessor accessor = createWebDriverAccessor(
                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);
View Full Code Here

            Attributes attributes) throws SAXException {

        // ref
        final String ref = attributes.getValue("ref");
        if (ref != null) {
            XMLPipelineContext context = dynamicProcess.getPipelineContext();
            context.setProperty(ProxyManager.class, ref, false);
        } else {
            forwardError(dynamicProcess,
                    "Proxy tag should have the 'ref' parameter " +
                    "set. Value is: ref='" + ref + "'");
        }
View Full Code Here

                entity.setName(from);
            }
        }

        // Add the entity to the collection of entities.
        XMLPipelineContext context = dynamicProcess.getPipelineContext();
        HTTPMessageEntities entities = getEntities(context);
        addProtocolMessageEntity(entities, entity);
    }
View Full Code Here

            // Convert the timeout in seconds into a Period.
            timeout = Period.treatNonPositiveAsIndefinitely(
                    timeoutInSeconds * 1000);
        } 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);

View Full Code Here

        serverMock.addTransaction(expectedRequest, responseContent);

            XMLPipelineConfiguration config = createPipelineConfiguration();
            WebDriverConfiguration webdConf = retrieveWebdConfiguration(config);
            webdConf.setResponseContainsPipelineMarkup(true);
            XMLPipelineContext context =
                pipelineFactory.createPipelineContext(config,
                            createRootEnvironmentInteraction());

            WebDriverAccessor accessor = createWebDriverAccessor();

            // register the parameters that this test requires with the
            // WebDriverRequest
            WebDriverRequest request = accessor.getRequest(context);
            HTTPMessageEntities parameters =
                    HTTPFactory.getDefaultInstance().
                    createHTTPMessageEntities();
            RequestParameter parameter1 = new RequestParameterImpl("name");
            parameter1.setValue("fred");
            RequestParameter parameter2 = new RequestParameterImpl("request2");
            parameter2.setValue("jane");
            parameters.add(parameter1);
            parameters.add(parameter2);
            request.setRequestParameters(parameters);

            context.setProperty(WebDriverAccessor.class, accessor, false);

            doInContextTest(context,
                            "InlineParameterTestCase.input.xml",
                            "InlineParameterTestCase.expected.xml");
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLPipelineContext

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.