Package org.apache.http.impl.cookie

Examples of org.apache.http.impl.cookie.BasicPathHandler.match()


    public void testBasicPathMatch1() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertTrue(h.match(cookie, origin));
    }
   
    public void testBasicPathMatch2() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/", false);
View Full Code Here


    public void testBasicPathMatch2() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertTrue(h.match(cookie, origin));
    }
   
    public void testBasicPathMatch3() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/more-stuff", false);
View Full Code Here

    public void testBasicPathMatch3() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/more-stuff", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertTrue(h.match(cookie, origin));
    }
   
    public void testBasicPathMatch4() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuffed", false);
View Full Code Here

    public void testBasicPathMatch4() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuffed", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertFalse(h.match(cookie, origin));
    }

    public void testBasicPathMatch5() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/otherstuff", false);
View Full Code Here

    public void testBasicPathMatch5() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/otherstuff", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertFalse(h.match(cookie, origin));
    }

    public void testBasicPathMatch6() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
View Full Code Here

    public void testBasicPathMatch6() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff/");
        assertTrue(h.match(cookie, origin));
    }

    public void testBasicPathMatch7() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
View Full Code Here

    public void testBasicPathMatch7() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
        CookieAttributeHandler h = new BasicPathHandler();
        assertTrue(h.match(cookie, origin));
    }

    public void testBasicPathValidate() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
View Full Code Here

            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
View Full Code Here

            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(new BasicClientCookie("name", "value"), null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

    public void testBasicPathMatch1() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertTrue(h.match(cookie, origin));
    }
   
    public void testBasicPathMatch2() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/", false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.