assertEquals(expResult, cookie.toString());
}
@Test
public void testNewCookieValueOf() {
NewCookie cookie = NewCookie.valueOf("fred=flintstone;Version=2");
assertEquals("fred", cookie.getName());
assertEquals("flintstone", cookie.getValue());
assertEquals(2, cookie.getVersion());
cookie = NewCookie.valueOf("fred=flintstone;Version=1;Max-Age=60");
assertEquals("fred", cookie.getName());
assertEquals("flintstone", cookie.getValue());
assertEquals(1, cookie.getVersion());
assertEquals(60, cookie.getMaxAge());
cookie = NewCookie.valueOf("fred=flintstone;Version=1;Comment=\"a modern stonage family\";Max-Age=60;Secure");
assertEquals("fred", cookie.getName());
assertEquals("flintstone", cookie.getValue());
assertEquals("a modern stonage family", cookie.getComment());
assertEquals(1, cookie.getVersion());
assertEquals(60, cookie.getMaxAge());
assertTrue(cookie.isSecure());
}