@throws Exception if the test fails
()
| 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 |
no test coverage detected