/* * Copyright (c) 2012, 2021, 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.
*/
//Run Test //testing HOST is selected for the default locale, // if specified on Windows or MacOSX
String osName = System.getProperty("os.name");
String param1 = "JRE"; if(osName.startsWith("Windows") || osName.startsWith("Mac")) {
param1 = "HOST";
}
testRun("HOST,JRE", "adapterTest", param1, defLang, defCtry);
//testing HOST is NOT selected for the non-default locale, if specified //Try to find the locale JRE supports which is not the platform default // (HOST supports that one)
String param2;
String param3; if (!defLang.equals("en") && !defFmtLang.equals("en")){
param2 = "en";
param3 = "US";
} elseif(!defLang.equals("ja") && !defFmtLang.equals("ja")){
param2 = "ja";
param3 = "JP";
} else {
param2 = "zh";
param3 = "CN";
}
testRun("HOST,JRE", "adapterTest", "JRE", param2, param3);
//testing SPI is NOT selected, as there is none.
testRun("SPI,JRE", "adapterTest", "JRE", "en", "US");
testRun("SPI,COMPAT", "adapterTest", "JRE", "en", "US");
//testing the order, variant #1. This assumes en_GB DateFormat data are // available both in JRE & CLDR
testRun("CLDR,JRE", "adapterTest", "CLDR", "en", "GB");
testRun("CLDR,COMPAT", "adapterTest", "CLDR", "en", "GB");
//testing the order, variant #2. This assumes en_GB DateFormat data are // available both in JRE & CLDR
testRun("JRE,CLDR", "adapterTest", "JRE", "en", "GB");
testRun("COMPAT,CLDR", "adapterTest", "JRE", "en", "GB");
//testing the order, variant #3 for non-existent locale in JRE // assuming "haw" is not in JRE.
testRun("JRE,CLDR", "adapterTest", "CLDR", "haw", "");
testRun("COMPAT,CLDR", "adapterTest", "CLDR", "haw", "");
//testing the order, variant #4 for the bug 7196799. CLDR's "zh" data // should be used in "zh_CN"
testRun("CLDR", "adapterTest", "CLDR", "zh", "CN");
//testing 8027289 fix, if the platform format default is zh_CN // this assumes Windows' currency symbol for zh_CN is \u00A5, the yen // (yuan) sign. if (defFmtLang.equals("zh") && defFmtCtry.equals("CN")) {
testRun("JRE,HOST", "bug8027289Test", "FFE5", "", "");
testRun("COMPAT,HOST", "bug8027289Test", "FFE5", "", "");
testRun("HOST", "bug8027289Test", "00A5", "", "");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.