Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.NameValuePair


    }

    public void testParseAttributeNullPath() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        cookiespec.parseAttribute(new NameValuePair("path", null), cookie);
        assertEquals("/", cookie.getPath());
    }
View Full Code Here


    }

    public void testParseAttributeBlankPath() throws Exception {
        CookieSpec cookiespec = new CookieSpecBase();
        Cookie cookie = new Cookie();
        cookiespec.parseAttribute(new NameValuePair("path", "   "), cookie);
        assertEquals("/", cookie.getPath());
    }
View Full Code Here

    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

    }

    public void testParseAttributeInvalidCookie() throws Exception {
        CookieSpec cookiespec = new NetscapeDraftSpec();
        try {
            cookiespec.parseAttribute(new NameValuePair("name", "value"), null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException expected) {
        }
    }
View Full Code Here

    public void testParseAttributeInvalidCookieExpires() throws Exception {
        CookieSpec cookiespec = new NetscapeDraftSpec();
        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

TOP

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

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.