--- /dev/null 2019-11-20 20:54:48.000000000 -0800 +++ new/test/jdk/sun/text/resources/Format/Bug8234288.java 2019-11-20 20:54:47.000000000 -0800 @@ -0,0 +1,77 @@ +import java.util.TimeZone; + +/* + * Copyright (c) 2014, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8234288 + * @modules jdk.localedata + * @summary updating time zone strings for Turkey Time + * @run main/othervm -Djava.locale.providers=JRE,SPI Bug8234288 + */ + +import java.util.Locale; +import java.util.TimeZone; + +public class Bug8234288 { + private static Locale ENGLISH = new Locale("en"); + private static String ZONE_EUROPE_ISTANBUL = "Europe/Istanbul"; + private static String ZONE_ASIA_ISTANBUL = "Asia/Istanbul"; + private static String ZONE_TURKEY = "Turkey"; + + private static String EXPECTED_TRT_LONG = "Turkey Time"; + private static String EXPECTED_TRT_SHORT = "TRT"; + private static String EXPECTED_TRST_LONG = "Turkey Summer Time"; + private static String EXPECTED_TRST_SHORT = "TRST"; + + public static void main(String[] arg) { + int errors = testTurkeyTimeZone(ZONE_EUROPE_ISTANBUL) + + testTurkeyTimeZone(ZONE_ASIA_ISTANBUL) + + testTurkeyTimeZone(ZONE_TURKEY); + + if (errors > 0) { + throw new RuntimeException(); + } + } + + private static int testTurkeyTimeZone(final String location) { + return testTimeZone(location, false, TimeZone.LONG, EXPECTED_TRT_LONG) + + testTimeZone(location, false, TimeZone.SHORT, EXPECTED_TRT_SHORT) + + testTimeZone(location, true, TimeZone.LONG, EXPECTED_TRST_LONG) + + testTimeZone(location, true, TimeZone.SHORT, EXPECTED_TRST_SHORT); + } + + private static int testTimeZone(final String location, final boolean isSummerTime, + final int style, final String expected) { + String timezone = TimeZone.getTimeZone(location) + .getDisplayName(isSummerTime, style, ENGLISH); + if (!timezone.equals(expected)) { + System.err.println("wrong time zone string for location '" + location + +"': got '" + timezone + "', expected'" + expected + "'"); + return 1; + } + + return 0; + } +} \ No newline at end of file