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

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


                    "TEST", "test.domain", "/testdir");
            checkEquality(entity);
        }
        {
            // test WebRequestCookie
            CookieImpl entity = new WebRequestCookie();
            entity.setName("TEST");
            entity.setMaxAge(1);
            entity.setComment("comment");
            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


        // =====================================================================
        //   Create Mocks
        // =====================================================================

        WebRequestCookie cookie = new WebRequestCookie();
        HTTPMessageEntities entities = new SimpleHTTPMessageEntities();

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

        expectAddSimpleElementProcess(cookie);

        entityFactoryMock.expects.createCookie().returns(cookie);

        contextMock.expects.getProperty(WebRequestCookie.class)
                .returns(entities);

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

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

        addAttribute("comment", comment);
        addAttribute("domain", domain);
        addAttribute("maxAge", Integer.toString(maxAge));
        addAttribute("path", path);
        addAttribute("secure", "" + secure);
        addAttribute("version", version.getName());

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

        dynamicProcessMock.expects.removeProcess(process);

        rule.endElement(dynamicProcessMock, elementName, process);

        assertNotNull(cookie);

        assertEquals("Name should match", name,
                cookie.getName());
        assertEquals("Value should match", value,
                cookie.getValue());
        assertEquals("From should match", from,
                cookie.getFrom());
        assertEquals("Comment should match", comment,
                cookie.getComment());
        assertEquals("Domain should match", domain,
                cookie.getDomain());
        assertEquals("MaxAge should match", maxAge,
                cookie.getMaxAge());
        assertEquals("Path should match", path,
                cookie.getPath());
        assertEquals("Secure should match", secure,
                cookie.isSecure());
        // returns an int
        assertEquals("Version should match", version,
                cookie.getVersion());
    }
View Full Code Here

        session.receivedSessionIDParam("test");
        assertEquals("receivedSessionIDParam() should trigger change " +
                "notification", 1, handler.getChanges());

        handler.reset();
        WebRequestCookie cookie = new WebRequestCookie();
        cookie.setName("henry");
        cookie.setValue("cookie");
        session.receivedSessionIDCookie(cookie);
        assertEquals("receivedSessionIDCookie() should trigger change " +
                "notification", 1, handler.getChanges());

        handler.reset();
View Full Code Here

TOP

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

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.