Skip to content

Commit 3e27a92

Browse files
author
duke
committed
Backport b453eb63c641e1e69b4aef57a220ebe45b9d1693
1 parent 9b71cd6 commit 3e27a92

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/jdk/java/net/CookieHandler/B6644726.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,8 +46,8 @@ private static void testCookieStore() throws Exception {
4646
// Let's test the default path
4747
lst.add("myCookie1=foo");
4848
// Then some alternate expires format
49-
lst.add("myCookie2=bar; path=/dir; expires=Tue, 19 Aug 2025 16:00:00 GMT");
50-
lst.add("myCookie3=test; path=/dir; expires=Tue Aug 19 2025 16:00:00 GMT-0100");
49+
lst.add("myCookie2=bar; path=/dir; expires=Fri, 19 Aug 4242 16:00:00 GMT");
50+
lst.add("myCookie3=test; path=/dir; expires=Fri Aug 19 4242 16:00:00 GMT-0100");
5151
// Then Netscape draft cookies and domains
5252
lst.add("myCookie4=test; domain=.sun.com; path=/dir/foo");
5353
HashMap<String, List<String>> map = new HashMap<String, List<String>>();
@@ -64,7 +64,8 @@ private static void testCookieStore() throws Exception {
6464
List<HttpCookie> cookies = cs.getCookies();
6565
// There should be 5 cookies if all dates parsed correctly
6666
if (cookies.size() != 5) {
67-
fail("Should have 5 cookies. Got only "+ cookies.size() + ", expires probably didn't parse correctly");
67+
fail("unexpected cookies: " + cookies + ", should have 5 cookies. Got only "
68+
+ cookies.size() + ", expires probably didn't parse correctly");
6869
}
6970
// Check Path for first Cookie
7071
for (HttpCookie c : cookies) {

0 commit comments

Comments
 (0)