public void testParseWithAll() throws Exception {
Header header = new BasicHeader("Set-Cookie",
"cookie-name=cookie-value;Version=1;Path=/commons;Domain=.apache.org;" +
"Comment=This is a comment.;secure;Expires=Thu, 01-Jan-1970 00:00:10 GMT");
CookieSpec cookiespec = new BrowserCompatSpec();
CookieOrigin origin = new CookieOrigin("www.apache.org", 80, "/commons/httpclient", true);
List<Cookie> cookies = cookiespec.parse(header, origin);
for (int i = 0; i < cookies.size(); i++) {
cookiespec.validate(cookies.get(i), origin);
}
assertEquals("Found 1 cookie.",1,cookies.size());
assertEquals("Name","cookie-name",cookies.get(0).getName());
assertEquals("Value","cookie-value",cookies.get(0).getValue());
assertEquals("Domain",".apache.org",cookies.get(0).getDomain());