Package org.apache.http

Examples of org.apache.http.Header$BufferedHeader


            // expected
        }
    }

    public void testParseSimple() throws Exception {
        Header header = new BasicHeader("Set-Cookie","cookie-name=cookie-value");
       
        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/path/path", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here


        assertTrue("Secure",!cookies.get(0).isSecure());
        assertEquals("Version",0,cookies.get(0).getVersion());
    }
    public void testParseSimple2() throws Exception {
        Header header = new BasicHeader("Set-Cookie", "cookie-name=cookie-value");
   
        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/path", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("Secure", !cookies.get(0).isSecure());
        assertEquals("Version", 0, cookies.get(0).getVersion());
    }
    public void testParseNoName() throws Exception {
        Header header = new BasicHeader("Set-Cookie","=stuff; path=/");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", false);
        try {
            List<Cookie> cookies = cookiespec.parse(header, origin);
View Full Code Here

            // expected
        }
    }
    public void testParseNoValue() throws Exception {
        Header header = new BasicHeader("Set-Cookie","cookie-name=");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("Secure",!cookies.get(0).isSecure());
        assertEquals("Version",0,cookies.get(0).getVersion());
    }

    public void testParseWithWhiteSpace() throws Exception {
        Header header = new BasicHeader("Set-Cookie"," cookie-name  =    cookie-value  ");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("ExpiryDate",null == cookies.get(0).getExpiryDate());
        assertTrue("Comment",null == cookies.get(0).getComment());
    }

    public void testParseWithQuotes() throws Exception {
        Header header = new BasicHeader("Set-Cookie"," cookie-name  =  \" cookie-value \" ;path=/");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1",80, "/", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("ExpiryDate",null == cookies.get(0).getExpiryDate());
        assertTrue("Comment",null == cookies.get(0).getComment());
    }

    public void testParseWithPath() throws Exception {
        Header header = new BasicHeader("Set-Cookie","cookie-name=cookie-value; Path=/path/");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/path/path", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("ExpiryDate",null == cookies.get(0).getExpiryDate());
        assertTrue("Comment",null == cookies.get(0).getComment());
    }

    public void testParseWithDomain() throws Exception {
        Header header = new BasicHeader("Set-Cookie","cookie-name=cookie-value; Domain=127.0.0.1");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", false);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("ExpiryDate",null == cookies.get(0).getExpiryDate());
        assertTrue("Comment",null == cookies.get(0).getComment());
    }

    public void testParseWithSecure() throws Exception {
        Header header = new BasicHeader("Set-Cookie","cookie-name=cookie-value; secure");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", true);
        List<Cookie> cookies = cookiespec.parse(header, origin);
        for (int i = 0; i < cookies.size(); i++) {
View Full Code Here

        assertTrue("ExpiryDate",null == cookies.get(0).getExpiryDate());
        assertTrue("Comment",null == cookies.get(0).getComment());
    }

    public void testParseWithComment() throws Exception {
        Header header = new BasicHeader("Set-Cookie",
            "cookie-name=cookie-value; comment=\"This is a comment.\"");

        CookieSpec cookiespec = new BrowserCompatSpec();
        CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", true);
        List<Cookie> cookies = cookiespec.parse(header, origin);
View Full Code Here

TOP

Related Classes of org.apache.http.Header$BufferedHeader

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.