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

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


            entity.setValue("test");
            checkEquality(entity);
        }
        {
            // test WebRequestHeader
            HeaderImpl entity = new WebRequestHeader();
            entity.setName("TEST");
            entity.setValue("test");
            checkEquality(entity);
        }
        {
            // test WebRequestParameter
            RequestParameterImpl entity = new WebRequestParameter();
            entity.setName("TEST");
            entity.setValue("test");
            checkEquality(entity);
        }

    }
View Full Code Here


        // =====================================================================
        //   Set Expectations
        // =====================================================================

        WebRequestHeader header = new WebRequestHeader();
        entityFactoryMock.expects.createHeader().returns(header);
        HTTPMessageEntities entities = new SimpleHTTPMessageEntities();
        entityFactoryMock.expects.createHTTPMessageEntities().returns(entities);

        expectAddSimpleElementProcess(header);

        contextMock.expects.getProperty(WebRequestHeader.class).returns(null);
        contextMock.expects.setProperty(WebRequestHeader.class,
                entities, false);

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        addAttribute("name", name);
        addAttribute("value", value);
        addAttribute("from", from);

        DynamicElementRule rule = new HeaderRule(entityFactoryMock);
        XMLProcess process = (XMLProcess) rule.startElement(dynamicProcessMock,
                elementName, attributes);

        dynamicProcessMock.expects.removeProcess(process);

        rule.endElement(dynamicProcessMock, elementName, process);

        assertNotNull(header);

        if (name == null) {
            assertEquals("Name value should match", from,
                    header.getName());
        } else {
            assertEquals("Name value should match", name,
                    header.getName());
        }
        assertEquals("Value value should match", value,
                header.getValue());
        assertEquals("From value should match", from,
                header.getFrom());
    }
View Full Code Here

TOP

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

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.