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

Method value

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

@throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

58 * @throws Exception if the test fails
59 */
60 @Test
61 public void value() throws Exception {
62 final Cookie cookie1 = new Cookie("localhost", "a", null, "/", null, false, false, null);
63 assertEquals("", cookie1.getValue());
64
65 final Cookie cookie2 = new Cookie("localhost", "a", "", "/", null, false, false, null);
66 assertEquals("", cookie2.getValue());
67
68 assertEquals(cookie1, cookie2);
69 assertEquals(cookie1.hashCode(), cookie2.hashCode());
70
71 final Cookie cookie3 = new Cookie("localhost", "a", "Ab", "/", null, false, false, null);
72 assertEquals("Ab", cookie3.getValue());
73
74 assertEquals(cookie1, cookie3);
75 assertEquals(cookie2, cookie3);
76 assertEquals(cookie1.hashCode(), cookie3.hashCode());
77 assertEquals(cookie2.hashCode(), cookie3.hashCode());
78 }
79
80 /**
81 * @throws Exception if the test fails

Callers 3

unusedFeaturesMethod · 0.45
collectStatisticsMethod · 0.45
collectStatisticsMethod · 0.45

Calls 3

getValueMethod · 0.95
hashCodeMethod · 0.95
assertEqualsMethod · 0.45

Tested by

no test coverage detected