Examples of BasicClientCookie


Examples of org.apache.http.impl.cookie.BasicClientCookie

            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.validate(new BasicClientCookie("name", "value"), null);
            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 {
            h.match(new BasicClientCookie("name", "value"), null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

            // expected
        }
    }

    public void testBasicPathParse() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicPathHandler();
        h.parse(cookie, "stuff");
        assertEquals("stuff", cookie.getPath());
        h.parse(cookie, "");
        assertEquals("/", cookie.getPath());
        h.parse(cookie, null);
        assertEquals("/", cookie.getPath());
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        h.parse(cookie, null);
        assertEquals("/", cookie.getPath());
    }

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

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertTrue(h.match(cookie, origin));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertTrue(h.match(cookie, origin));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertFalse(h.match(cookie, origin));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        assertFalse(h.match(cookie, origin));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff/");
        assertTrue(h.match(cookie, origin));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        assertTrue(h.match(cookie, origin));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie

        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);
        CookieAttributeHandler h = new BasicPathHandler();
        cookie.setPath("/stuff");
        h.validate(cookie, origin);
        cookie.setPath("/stuffed");
        try {
            h.validate(cookie, origin);
            fail("MalformedCookieException must have been thrown");
        } catch (MalformedCookieException ex) {
            // expected
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.