Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.Cookie


      if (index > -1)
      {
         targetServer = targetServer.substring(0, index);
      }
     
      Cookie copy = new Cookie(targetServer,
                               toCopy.getName(),
                               toCopy.getValue(),
                               "/",
                               null,
                               false);
View Full Code Here


        }
    }

    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

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

    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

        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

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.