Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.Cookie


        assertEquals("/", cookie.getPath());
    }

    public void testParseAttributeNullDomain() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.parseAttribute(new NameValuePair("domain", null), cookie);
            fail("MalformedCookieException must have been thrown");
        } catch (MalformedCookieException expected) {
        }
View Full Code Here


        }
    }

    public void testParseAttributeBlankDomain() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.parseAttribute(new NameValuePair("domain", "   "), cookie);
            fail("MalformedCookieException must have been thrown");
        } catch (MalformedCookieException expected) {
        }
View Full Code Here

        }
    }

    public void testParseAttributeNullMaxAge() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.parseAttribute(new NameValuePair("max-age", null), cookie);
            fail("MalformedCookieException must have been thrown");
        } catch (MalformedCookieException expected) {
        }
View Full Code Here

        }
    }

    public void testParseAttributeInvalidMaxAge() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.parseAttribute(new NameValuePair("max-age", "crap"), cookie);
            fail("MalformedCookieException must have been thrown");
        } catch (MalformedCookieException expected) {
        }
View Full Code Here

        }
    }

    public void testParseAttributeNullExpires() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.parseAttribute(new NameValuePair("expires", null), cookie);
            fail("MalformedCookieException must have been thrown");
        } catch (MalformedCookieException expected) {
        }
View Full Code Here

        }
    }

    public void testParseAttributeUnknownValue() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        cookiespec.parseAttribute(new NameValuePair("nonsense", null), cookie);
    }
View Full Code Here

        cookiespec.parseAttribute(new NameValuePair("nonsense", null), cookie);
    }
   
    public void testValidateNullHost() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.validate(null, 80, "/", false, cookie);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException expected) {
        }
View Full Code Here

        }
    }

    public void testValidateBlankHost() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.validate("   ", 80, "/", false, cookie);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException expected) {
        }
View Full Code Here

        }
    }

    public void testValidateNullPath() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        try {
            cookiespec.validate("host", 80, null, false, cookie);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException expected) {
        }
View Full Code Here

        }
    }

    public void testValidateBlankPath() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie("host", "name", "value", "/", null, false);
        cookiespec.validate("host", 80, "   ", false, cookie);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.Cookie

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.