8233886: TEST_BUG jdk/java/net/CookieHandler/B6791927.java hit hardcoded expiration date
authorigerasim
Mon, 11 Nov 2019 05:09:31 -0800
changeset 59009 0c5fb962e11e
parent 59008 333c2b653434
child 59010 d4cae08239f7
8233886: TEST_BUG jdk/java/net/CookieHandler/B6791927.java hit hardcoded expiration date Reviewed-by: chegar, vtewari
test/jdk/java/net/CookieHandler/B6791927.java
--- a/test/jdk/java/net/CookieHandler/B6791927.java	Mon Nov 11 13:20:26 2019 +0100
+++ b/test/jdk/java/net/CookieHandler/B6791927.java	Mon Nov 11 05:09:31 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,9 @@
 
 /**
  * @test
- * @bug 6791927
+ * @bug 6791927 8233886
  * @summary Wrong Locale in HttpCookie::expiryDate2DeltaSeconds
+ * @run main/othervm B6791927
  */
 
 import java.net.*;
@@ -32,12 +33,14 @@
 import java.util.Locale;
 
 public class B6791927 {
-    public static final void main( String[] aaParamters ) throws Exception{
+    public static final void main(String[] aaParamters) throws Exception {
         Locale reservedLocale = Locale.getDefault();
         try {
             // Forces a non US locale
             Locale.setDefault(Locale.FRANCE);
-            List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Sat, 09-Nov-2019 23:12:40 GMT");
+            List<HttpCookie> cookies = HttpCookie.parse("set-cookie:" +
+                    " CUSTOMER=WILE_E_COYOTE;" +
+                    " expires=Sat, 09-Nov-2041 23:12:40 GMT");
             if (cookies == null || cookies.isEmpty()) {
                 throw new RuntimeException("No cookie found");
             }