853N/A/*
5556N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
853N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
853N/A *
853N/A * This code is free software; you can redistribute it and/or modify it
853N/A * under the terms of the GNU General Public License version 2 only, as
853N/A * published by the Free Software Foundation.
853N/A *
853N/A * This code is distributed in the hope that it will be useful, but WITHOUT
853N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
853N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
853N/A * version 2 for more details (a copy is included in the LICENSE file that
853N/A * accompanied this code).
853N/A *
853N/A * You should have received a copy of the GNU General Public License version
853N/A * 2 along with this work; if not, write to the Free Software Foundation,
853N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
853N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
853N/A */
853N/A
853N/A/**
853N/A * @test
853N/A * @bug 6791927
853N/A * @summary Wrong Locale in HttpCookie::expiryDate2DeltaSeconds
853N/A */
853N/A
853N/Aimport java.net.*;
853N/Aimport java.util.List;
853N/Aimport java.util.Locale;
853N/A
853N/Apublic class B6791927 {
853N/A public static final void main( String[] aaParamters ) throws Exception{
853N/A // Forces a non US locale
853N/A Locale.setDefault(Locale.FRANCE);
5556N/A List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Sat, 09-Nov-2019 23:12:40 GMT");
853N/A if (cookies == null || cookies.isEmpty()) {
853N/A throw new RuntimeException("No cookie found");
853N/A }
853N/A for (HttpCookie c : cookies) {
853N/A if (c.getMaxAge() == 0) {
853N/A throw new RuntimeException("Expiration date shouldn't be 0");
853N/A }
853N/A }
853N/A }
853N/A}