MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / domain

Method domain

src/test/java/org/htmlunit/util/CookieTest.java:37–55  ·  view source on GitHub ↗

@throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

35 * @throws Exception if the test fails
36 */
37 @Test
38 public void domain() throws Exception {
39 try {
40 new Cookie(null, "a", "one", null, null, false, false, null);
41 fail("IllegalArgumentException expected");
42 }
43 catch (final IllegalArgumentException e) {
44 // expected
45 }
46
47 final Cookie cookie1 = new Cookie("localhost", "a", "one", "/", null, false, false, null);
48 assertEquals("localhost", cookie1.getDomain());
49
50 final Cookie cookie2 = new Cookie("lOcAlHOST", "a", "one", "/", null, false, false, null);
51 assertEquals("localhost", cookie2.getDomain());
52
53 assertEquals(cookie1, cookie2);
54 assertEquals(cookie1.hashCode(), cookie2.hashCode());
55 }
56
57 /**
58 * @throws Exception if the test fails

Callers 1

matchMethod · 0.45

Calls 3

getDomainMethod · 0.95
hashCodeMethod · 0.95
assertEqualsMethod · 0.45

Tested by

no test coverage detected