1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8176841
27 * @summary Tests java.time classes deals with Unicode extensions
28 * correctly.
29 * @modules jdk.localedata
30 */
31 package test.java.time.format;
32
33 import static org.testng.Assert.assertEquals;
34
35 import java.time.DayOfWeek;
36 import java.time.ZonedDateTime;
37 import java.time.ZoneId;
38 import java.time.chrono.Chronology;
39 import java.time.chrono.HijrahChronology;
40 import java.time.chrono.IsoChronology;
41 import java.time.chrono.JapaneseChronology;
42 import java.time.format.DateTimeFormatter;
43 import java.time.format.DateTimeFormatterBuilder;
44 import java.time.format.FormatStyle;
45 import java.time.temporal.ChronoField;
46 import java.time.temporal.TemporalField;
670 {"usinvev", "America/Indiana/Vevay"},
671 {"usjnu", "America/Juneau"},
672 {"usknx", "America/Indiana/Knox"},
673 {"uslax", "America/Los_Angeles"},
674 {"uslui", "America/Louisville"},
675 {"usmnm", "America/Menominee"},
676 {"usmtm", "America/Metlakatla"},
677 {"usmoc", "America/Kentucky/Monticello"},
678 {"usndcnt", "America/North_Dakota/Center"},
679 {"usndnsl", "America/North_Dakota/New_Salem"},
680 {"usnyc", "America/New_York"},
681 {"usoea", "America/Indiana/Vincennes"},
682 {"usome", "America/Nome"},
683 {"usphx", "America/Phoenix"},
684 {"ussit", "America/Sitka"},
685 {"ustel", "America/Indiana/Tell_City"},
686 {"uswlz", "America/Indiana/Winamac"},
687 {"uswsq", "America/Indiana/Petersburg"},
688 {"usxul", "America/North_Dakota/Beulah"},
689 {"usyak", "America/Yakutat"},
690 {"utc", "Etc/GMT"},
691 {"utce01", "Etc/GMT-1"},
692 {"utce02", "Etc/GMT-2"},
693 {"utce03", "Etc/GMT-3"},
694 {"utce04", "Etc/GMT-4"},
695 {"utce05", "Etc/GMT-5"},
696 {"utce06", "Etc/GMT-6"},
697 {"utce07", "Etc/GMT-7"},
698 {"utce08", "Etc/GMT-8"},
699 {"utce09", "Etc/GMT-9"},
700 {"utce10", "Etc/GMT-10"},
701 {"utce11", "Etc/GMT-11"},
702 {"utce12", "Etc/GMT-12"},
703 {"utce13", "Etc/GMT-13"},
704 {"utce14", "Etc/GMT-14"},
705 {"utcw01", "Etc/GMT+1"},
706 {"utcw02", "Etc/GMT+2"},
707 {"utcw03", "Etc/GMT+3"},
708 {"utcw04", "Etc/GMT+4"},
709 {"utcw05", "Etc/GMT+5"},
710 {"utcw06", "Etc/GMT+6"},
|
1 /*
2 * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8176841 8202537
27 * @summary Tests java.time classes deals with Unicode extensions
28 * correctly.
29 * @modules jdk.localedata
30 */
31 package test.java.time.format;
32
33 import static org.testng.Assert.assertEquals;
34
35 import java.time.DayOfWeek;
36 import java.time.ZonedDateTime;
37 import java.time.ZoneId;
38 import java.time.chrono.Chronology;
39 import java.time.chrono.HijrahChronology;
40 import java.time.chrono.IsoChronology;
41 import java.time.chrono.JapaneseChronology;
42 import java.time.format.DateTimeFormatter;
43 import java.time.format.DateTimeFormatterBuilder;
44 import java.time.format.FormatStyle;
45 import java.time.temporal.ChronoField;
46 import java.time.temporal.TemporalField;
670 {"usinvev", "America/Indiana/Vevay"},
671 {"usjnu", "America/Juneau"},
672 {"usknx", "America/Indiana/Knox"},
673 {"uslax", "America/Los_Angeles"},
674 {"uslui", "America/Louisville"},
675 {"usmnm", "America/Menominee"},
676 {"usmtm", "America/Metlakatla"},
677 {"usmoc", "America/Kentucky/Monticello"},
678 {"usndcnt", "America/North_Dakota/Center"},
679 {"usndnsl", "America/North_Dakota/New_Salem"},
680 {"usnyc", "America/New_York"},
681 {"usoea", "America/Indiana/Vincennes"},
682 {"usome", "America/Nome"},
683 {"usphx", "America/Phoenix"},
684 {"ussit", "America/Sitka"},
685 {"ustel", "America/Indiana/Tell_City"},
686 {"uswlz", "America/Indiana/Winamac"},
687 {"uswsq", "America/Indiana/Petersburg"},
688 {"usxul", "America/North_Dakota/Beulah"},
689 {"usyak", "America/Yakutat"},
690 {"utc", "Etc/UTC"},
691 {"utce01", "Etc/GMT-1"},
692 {"utce02", "Etc/GMT-2"},
693 {"utce03", "Etc/GMT-3"},
694 {"utce04", "Etc/GMT-4"},
695 {"utce05", "Etc/GMT-5"},
696 {"utce06", "Etc/GMT-6"},
697 {"utce07", "Etc/GMT-7"},
698 {"utce08", "Etc/GMT-8"},
699 {"utce09", "Etc/GMT-9"},
700 {"utce10", "Etc/GMT-10"},
701 {"utce11", "Etc/GMT-11"},
702 {"utce12", "Etc/GMT-12"},
703 {"utce13", "Etc/GMT-13"},
704 {"utce14", "Etc/GMT-14"},
705 {"utcw01", "Etc/GMT+1"},
706 {"utcw02", "Etc/GMT+2"},
707 {"utcw03", "Etc/GMT+3"},
708 {"utcw04", "Etc/GMT+4"},
709 {"utcw05", "Etc/GMT+5"},
710 {"utcw06", "Etc/GMT+6"},
|