@Test
public void testParseWithDomain() throws Exception {

    Header header = new BasicHeader("Set-Cookie","cookie-name=cookie-value; Domain=127.0.0.1");
    CookieSpec cookiespec = new BrowserCompatSpec();
    CookieOrigin origin = new CookieOrigin("127.0.0.1", 80, "/", false);
    List<Cookie> cookies = cookiespec.parse(header, origin);
    for (int i = 0; i < cookies.size(); i++) {
        cookiespec.validate(cookies.get(i), origin);
    }
    Assert.assertEquals("Found 1 cookie.",1,cookies.size());
    Assert.assertEquals("Name","cookie-name",cookies.get(0).getName());
    Assert.assertEquals("Value","cookie-value",cookies.get(0).getValue());
    Assert.assertEquals("Domain","127.0.0.1",cookies.get(0).getDomain());
    Assert.assertEquals("Path","/",cookies.get(0).getPath());
    Assert.assertTrue("Secure",!cookies.get(0).isSecure());
    Assert.assertTrue("ExpiryDate",null == cookies.get(0).getExpiryDate());
    Assert.assertTrue("Comment",null == cookies.get(0).getComment());
}