* @tests java.net.HttpCookie(String, String).
*
* @since 1.6
*/
public void test_HttpCookie_LString_LString() {
assertNotNull(new HttpCookie("harmony_6", "test,sem"));
assertNotNull(new HttpCookie("harmony_6", null));
assertNotNull(new HttpCookie("harmony ", null));
assertEquals("harmony", new HttpCookie("harmony ", null).getName());
constructHttpCookie("", null);
String value = "value";
constructHttpCookie("", value);
constructHttpCookie("harmony,", value);
constructHttpCookie("harmony;", value);
constructHttpCookie("$harmony", value);
constructHttpCookie("n\tame", value);
constructHttpCookie("n\rame", value);
constructHttpCookie("n\r\name", value);
constructHttpCookie("Comment", value);
constructHttpCookie("CommentURL", value);
constructHttpCookie("Domain", value);
constructHttpCookie("Discard", value);
constructHttpCookie("Max-Age", value);
constructHttpCookie(" Path ", value);
constructHttpCookie("Port ", value);
constructHttpCookie("SeCure", value);
constructHttpCookie("VErsion", value);
constructHttpCookie("expires", value);
constructHttpCookie("na\u0085me", value);
constructHttpCookie("\u2028me", value);
constructHttpCookie("na\u2029me", value);
try {
new HttpCookie(null, value);
fail("Should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
try {
new HttpCookie("\u007f", value);
fail("Should throw IllegalArgumentException");
} catch (IllegalArgumentException e) {
// expected
}
HttpCookie cookie = new HttpCookie("harmony!", null);
assertEquals("harmony!", cookie.getName());
cookie = new HttpCookie("harmon$y", null);
assertEquals("harmon$y", cookie.getName());
}