author | alanb |
Tue, 18 Dec 2018 10:26:15 +0000 | |
changeset 53038 | 9dd0a2fdec24 |
parent 52173 | e4b9475b0508 |
child 53163 | 76f7dbf458fe |
permissions | -rw-r--r-- |
52173
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
1 |
/* |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
2 |
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
4 |
* |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
8 |
* |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
13 |
* accompanied this code). |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
14 |
* |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
18 |
* |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
21 |
* questions. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
22 |
*/ |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
23 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
24 |
/* |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
25 |
* @test |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
26 |
* @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577 |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
27 |
* 8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006 |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
28 |
* 8150432 |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
29 |
* @summary tests for "java.locale.providers" system property |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
30 |
* @library /test/lib |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
31 |
* @build LocaleProviders |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
32 |
* providersrc.spi.src.tznp |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
33 |
* providersrc.spi.src.tznp8013086 |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
34 |
* @modules java.base/sun.util.locale |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
35 |
* java.base/sun.util.locale.provider |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
36 |
* @run main LocaleProvidersRun |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
37 |
*/ |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
38 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
39 |
import java.util.Locale; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
40 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
41 |
import jdk.test.lib.JDKToolLauncher; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
42 |
import jdk.test.lib.process.ProcessTools; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
43 |
import jdk.test.lib.Utils; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
44 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
45 |
public class LocaleProvidersRun { |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
46 |
public static void main(String[] args) throws Throwable { |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
47 |
//get the platform default locales |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
48 |
Locale platDefLoc = Locale.getDefault(Locale.Category.DISPLAY); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
49 |
String defLang = platDefLoc.getLanguage(); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
50 |
String defCtry = platDefLoc.getCountry(); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
51 |
System.out.println("DEFLANG = " + defLang); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
52 |
System.out.println("DEFCTRY = " + defCtry); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
53 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
54 |
Locale platDefFormat = Locale.getDefault(Locale.Category.FORMAT); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
55 |
String defFmtLang = platDefFormat.getLanguage(); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
56 |
String defFmtCtry = platDefFormat.getCountry(); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
57 |
System.out.println("DEFFMTLANG = " + defFmtLang); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
58 |
System.out.println("DEFFMTCTRY = " + defFmtCtry); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
59 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
60 |
//Run Test |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
61 |
//testing HOST is selected for the default locale, |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
62 |
// if specified on Windows or MacOSX |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
63 |
String osName = System.getProperty("os.name"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
64 |
String param1 = "JRE"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
65 |
if(osName.startsWith("Windows") || osName.startsWith("Mac")) { |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
66 |
param1 = "HOST"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
67 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
68 |
testRun("HOST,JRE", "adapterTest", param1, defLang, defCtry); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
69 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
70 |
//testing HOST is NOT selected for the non-default locale, if specified |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
71 |
//Try to find the locale JRE supports which is not the platform default |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
72 |
// (HOST supports that one) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
73 |
String param2; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
74 |
String param3; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
75 |
if (!defLang.equals("en") && !defFmtLang.equals("en")){ |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
76 |
param2 = "en"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
77 |
param3 = "US"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
78 |
} else if(!defLang.equals("ja") && !defFmtLang.equals("ja")){ |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
79 |
param2 = "ja"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
80 |
param3 = "JP"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
81 |
} else { |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
82 |
param2 = "zh"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
83 |
param3 = "CN"; |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
84 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
85 |
testRun("HOST,JRE", "adapterTest", "JRE", param2, param3); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
86 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
87 |
//testing SPI is NOT selected, as there is none. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
88 |
testRun("SPI,JRE", "adapterTest", "JRE", "en", "US"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
89 |
testRun("SPI,COMPAT", "adapterTest", "JRE", "en", "US"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
90 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
91 |
//testing the order, variant #1. This assumes en_GB DateFormat data are |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
92 |
// available both in JRE & CLDR |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
93 |
testRun("CLDR,JRE", "adapterTest", "CLDR", "en", "GB"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
94 |
testRun("CLDR,COMPAT", "adapterTest", "CLDR", "en", "GB"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
95 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
96 |
//testing the order, variant #2. This assumes en_GB DateFormat data are |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
97 |
// available both in JRE & CLDR |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
98 |
testRun("JRE,CLDR", "adapterTest", "JRE", "en", "GB"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
99 |
testRun("COMPAT,CLDR", "adapterTest", "JRE", "en", "GB"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
100 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
101 |
//testing the order, variant #3 for non-existent locale in JRE |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
102 |
// assuming "haw" is not in JRE. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
103 |
testRun("JRE,CLDR", "adapterTest", "CLDR", "haw", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
104 |
testRun("COMPAT,CLDR", "adapterTest", "CLDR", "haw", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
105 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
106 |
//testing the order, variant #4 for the bug 7196799. CLDR's "zh" data |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
107 |
// should be used in "zh_CN" |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
108 |
testRun("CLDR", "adapterTest", "CLDR", "zh", "CN"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
109 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
110 |
//testing FALLBACK provider. SPI and invalid one cases. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
111 |
testRun("SPI", "adapterTest", "FALLBACK", "en", "US"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
112 |
testRun("FOO", "adapterTest", "CLDR", "en", "US"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
113 |
testRun("BAR,SPI", "adapterTest", "FALLBACK", "en", "US"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
114 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
115 |
//testing 7198834 fix. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
116 |
testRun("HOST", "bug7198834Test", "", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
117 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
118 |
//testing 8000245 fix. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
119 |
testRun("JRE", "tzNameTest", "Europe/Moscow", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
120 |
testRun("COMPAT", "tzNameTest", "Europe/Moscow", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
121 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
122 |
//testing 8000615 fix. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
123 |
testRun("JRE", "tzNameTest", "America/Los_Angeles", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
124 |
testRun("COMPAT", "tzNameTest", "America/Los_Angeles", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
125 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
126 |
//testing 8001440 fix. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
127 |
testRun("CLDR", "bug8001440Test", "", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
128 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
129 |
//testing 8010666 fix. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
130 |
if (defLang.equals("en")) { |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
131 |
testRun("HOST", "bug8010666Test", "", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
132 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
133 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
134 |
//testing 8013086 fix. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
135 |
testRun("JRE,SPI", "bug8013086Test", "ja", "JP", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
136 |
testRun("COMPAT,SPI", "bug8013086Test", "ja", "JP", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
137 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
138 |
//testing 8013903 fix. (Windows only) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
139 |
testRun("HOST,JRE", "bug8013903Test", "", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
140 |
testRun("HOST", "bug8013903Test", "", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
141 |
testRun("HOST,COMPAT", "bug8013903Test", "", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
142 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
143 |
//testing 8027289 fix, if the platform format default is zh_CN |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
144 |
// this assumes Windows' currency symbol for zh_CN is \u00A5, the yen |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
145 |
// (yuan) sign. |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
146 |
if (!defLang.equals("en") && !defCtry.equals("CN")){ |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
147 |
testRun("JRE,HOST", "bug8027289Test", "FFE5", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
148 |
testRun("COMPAT,HOST", "bug8027289Test", "FFE5", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
149 |
testRun("HOST", "bug8027289Test", "00A5", "", ""); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
150 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
151 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
152 |
|
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
153 |
private static void testRun(String prefList, String methodName, |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
154 |
String param1, String param2, String param3) throws Throwable{ |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
155 |
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java"); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
156 |
launcher.addToolArg("-cp") |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
157 |
.addToolArg(Utils.TEST_CLASS_PATH) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
158 |
.addToolArg("-Djava.locale.providers=" + prefList) |
53038
9dd0a2fdec24
8215449: Several tests failing when jtreg run with -vmoption:--illegal-access=deny
alanb
parents:
52173
diff
changeset
|
159 |
.addToolArg("--add-exports=java.base/sun.util.locale.provider=ALL-UNNAMED") |
52173
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
160 |
.addToolArg("LocaleProviders") |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
161 |
.addToolArg(methodName) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
162 |
.addToolArg(param1) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
163 |
.addToolArg(param2) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
164 |
.addToolArg(param3); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
165 |
int exitCode = ProcessTools.executeCommand(launcher.getCommand()) |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
166 |
.getExitValue(); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
167 |
if (exitCode != 0) { |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
168 |
throw new RuntimeException("Unexpected exit code: " + exitCode); |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
169 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
170 |
} |
e4b9475b0508
8210403: Refactor java.util.Locale:i18n shell tests to plain java tests
mli
parents:
diff
changeset
|
171 |
} |