static void misc() {
header("Test equals()");
// test equals()
HttpCookie c1 = new HttpCookie("Customer", "WILE_E_COYOTE");
c1.setDomain(".coyote.org");
c1.setPath("/acme");
HttpCookie c2 = (HttpCookie)c1.clone();
eq(c1, c2, true);
// test equals() when domain and path are null
c1 = new HttpCookie("Customer", "WILE_E_COYOTE");
c2 = new HttpCookie("CUSTOMER", "WILE_E_COYOTE");
eq(c1, c2, true);
// path is case-sensitive
c1 = new HttpCookie("Customer", "WILE_E_COYOTE");
c2 = new HttpCookie("CUSTOMER", "WILE_E_COYOTE");
c1.setPath("/acme");
c2.setPath("/ACME");
eq(c1, c2, false);
header("Test domainMatches()");
dm(".foo.com", "y.x.foo.com", false);
dm(".foo.com", "x.foo.com", true);
dm(".com", "whatever.com", false);
dm(".com.", "whatever.com", false);
dm(".ajax.com", "ajax.com", true);
dm(".local", "example.local", true);
// bug 6277808
testCount++;
try {
c1 = new HttpCookie("", "whatever");
} catch (IllegalArgumentException ignored) {
// expected exception; no-op
}
}