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