0N/A/*
3261N/A * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/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.
0N/A */
0N/A
0N/A/*
0N/A *@test
0N/A *@bug 6317929 6409419
0N/A *@summary Test case for tzdata2005m support for 9 locales
0N/A */
0N/A
0N/Aimport java.util.Locale;
0N/Aimport java.util.TimeZone;
0N/A
0N/Apublic class Bug6317929 {
0N/A static Locale[] locales2Test = new Locale[] {
0N/A new Locale("en"),
0N/A new Locale("de"),
0N/A new Locale("es"),
0N/A new Locale("fr"),
0N/A new Locale("it"),
0N/A new Locale("ja"),
0N/A new Locale("ko"),
0N/A new Locale("sv"),
0N/A new Locale("zh","CN"),
0N/A new Locale("zh","TW")
0N/A };
0N/A
0N/A public static void main(String[] args) {
0N/A Locale tzLocale;
0N/A
0N/A TimeZone Coral_Harbour = TimeZone.getTimeZone("America/Coral_Harbour");
0N/A tzLocale = locales2Test[0];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Eastern Standard Time"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"Eastern Standard Time\"");
0N/A tzLocale = locales2Test[1];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u00d6stliche Normalzeit"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"\u00d6stliche Normalzeit\"");
0N/A tzLocale = locales2Test[2];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Hora est\u00e1ndar Oriental"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"Hora est\u00e1ndar Oriental\"");
0N/A tzLocale = locales2Test[3];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Heure normale de l'Est"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"Heure normale de l'Est\"");
0N/A tzLocale = locales2Test[4];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Ora solare USA orientale"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"Ora solare USA orientale\"");
0N/A tzLocale = locales2Test[5];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u6771\u90e8\u6a19\u6e96\u6642"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"\u6771\u90e8\u6a19\u6e96\u6642\"");
0N/A tzLocale = locales2Test[6];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\ub3d9\ubd80 \ud45c\uc900\uc2dc"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"\ub3d9\ubd80 \ud45c\uc900\uc2dc\"");
0N/A tzLocale = locales2Test[7];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Eastern, normaltid"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"Eastern, normaltid\"");
0N/A tzLocale = locales2Test[8];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\"");
0N/A tzLocale = locales2Test[9];
0N/A if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u6771\u65b9\u6a19\u6e96\u6642\u9593"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "America/Coral_Harbour should be " +
0N/A "\"\u6771\u65b9\u6a19\u6e96\u6642\u9593\"");
0N/A
0N/A TimeZone Currie = TimeZone.getTimeZone("Australia/Currie");
0N/A tzLocale = locales2Test[0];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Eastern Standard Time (New South Wales)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"Eastern Standard Time " +
0N/A "(New South Wales)\"");
0N/A tzLocale = locales2Test[1];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u00d6stliche Normalzeit (New South Wales)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"\u00d6stliche Normalzeit " +
0N/A "(New South Wales)\"");
0N/A tzLocale = locales2Test[2];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Hora est\u00e1ndar Oriental (Nueva Gales del Sur)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"Hora est\u00e1ndar Oriental " +
0N/A "(Nueva Gales del Sur)\"");
0N/A tzLocale = locales2Test[3];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Heure normale de l'Est (Nouvelle-Galles du Sud)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"Heure normale de l'Est " +
0N/A "(Nouvelle-Galles du Sud)\"");
0N/A tzLocale = locales2Test[4];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("Ora solare dell'Australia orientale (Nuovo Galles del Sud)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"Ora solare dell'Australia orientale " +
0N/A "(Nuovo Galles del Sud)\"");
0N/A tzLocale = locales2Test[5];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u6771\u90e8\u6a19\u6e96\u6642 " +
0N/A "(\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9\u30a6\u30a7\u30fc\u30eb\u30ba)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"\u6771\u90e8\u6a19\u6e96\u6642 " +
0N/A "(\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9" +
0N/A "\u30a6\u30a7\u30fc\u30eb\u30ba)\"");
0N/A tzLocale = locales2Test[6];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\ub3d9\ubd80 \ud45c\uc900\uc2dc(\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"\ub3d9\ubd80 \ud45c\uc900\uc2dc" +
0N/A "(\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)\"");
0N/A tzLocale = locales2Test[7];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
2315N/A ("Eastern, normaltid (Nya Sydwales)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
2315N/A "\"Eastern, normaltid " +
0N/A "(Nya Sydwales)\"");
0N/A tzLocale = locales2Test[8];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u65b0\u5357\u5a01\u5c14\u65af\uff09"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4 " +
0N/A "\uff08\u65b0\u5357\u5a01\u5c14\u65af\uff09\"");
0N/A tzLocale = locales2Test[9];
0N/A if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
0N/A ("\u6771\u65b9\u6a19\u6e96\u6642\u9593 (\u65b0\u5357\u5a01\u723e\u65af)"))
0N/A throw new RuntimeException("\n" + tzLocale + ": LONG, " +
0N/A "non-daylight saving name for " +
0N/A "Australia/Currie should be " +
0N/A "\"\u6771\u65b9\u6a19\u6e96\u6642\u9593 " +
0N/A "(\u65b0\u5357\u5a01\u723e\u65af)\"");
0N/A }
0N/A}