Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
71006342
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
71006342
编写于
5月 15, 2013
作者:
N
naoto
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8013233: java/util/Locale/LocaleProviders.sh fails
Reviewed-by: okutsu
上级
01e8a349
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
11 deletion
+51
-11
test/java/util/Locale/LocaleProviders.java
test/java/util/Locale/LocaleProviders.java
+50
-10
test/java/util/Locale/LocaleProviders.sh
test/java/util/Locale/LocaleProviders.sh
+1
-1
未找到文件。
test/java/util/Locale/LocaleProviders.java
浏览文件 @
71006342
...
...
@@ -118,27 +118,67 @@ public class LocaleProviders {
if
(
System
.
getProperty
(
"os.name"
).
startsWith
(
"Windows"
))
{
NumberFormat
nf
=
NumberFormat
.
getInstance
(
Locale
.
US
);
try
{
double
ver
=
nf
.
parse
(
System
.
getProperty
(
"os.version"
)).
doubleValue
();
double
ver
=
nf
.
parse
(
System
.
getProperty
(
"os.version"
))
.
doubleValue
();
System
.
out
.
printf
(
"Windows version: %.1f\n"
,
ver
);
if
(
ver
>=
6.0
)
{
LocaleProviderAdapter
lda
=
LocaleProviderAdapter
.
getAdapter
(
LocaleNameProvider
.
class
,
Locale
.
ENGLISH
);
LocaleProviderAdapter
lda
=
LocaleProviderAdapter
.
getAdapter
(
LocaleNameProvider
.
class
,
Locale
.
ENGLISH
);
LocaleProviderAdapter
.
Type
type
=
lda
.
getAdapterType
();
if
(
type
==
LocaleProviderAdapter
.
Type
.
HOST
)
{
LocaleNameProvider
lnp
=
lda
.
getLocaleNameProvider
();
Locale
mkmk
=
Locale
.
forLanguageTag
(
"mk-MK"
);
String
result
=
mkmk
.
getDisplayLanguage
(
Locale
.
ENGLISH
);
if
(!
"Macedonian (FYROM)"
.
equals
(
result
))
{
throw
new
RuntimeException
(
"Windows locale name provider did not return expected localized language name for \"mk\". Returned name was \""
+
result
+
"\""
);
String
hostResult
=
lnp
.
getDisplayLanguage
(
mkmk
.
getLanguage
(),
Locale
.
ENGLISH
);
System
.
out
.
printf
(
" Display language name for"
+
" (mk_MK): result(HOST): \"%s\", returned: \"%s\"\n"
,
hostResult
,
result
);
if
(
result
==
null
||
hostResult
!=
null
&&
!
result
.
equals
(
hostResult
))
{
throw
new
RuntimeException
(
"Display language name"
+
" mismatch for \"mk\". Returned name was"
+
" \""
+
result
+
"\", result(HOST): \""
+
hostResult
+
"\""
);
}
result
=
Locale
.
US
.
getDisplayLanguage
(
Locale
.
ENGLISH
);
if
(!
"English"
.
equals
(
result
))
{
throw
new
RuntimeException
(
"Windows locale name provider did not return expected localized language name for \"en\". Returned name was \""
+
result
+
"\""
);
hostResult
=
lnp
.
getDisplayLanguage
(
Locale
.
US
.
getLanguage
(),
Locale
.
ENGLISH
);
System
.
out
.
printf
(
" Display language name for"
+
" (en_US): result(HOST): \"%s\", returned: \"%s\"\n"
,
hostResult
,
result
);
if
(
result
==
null
||
hostResult
!=
null
&&
!
result
.
equals
(
hostResult
))
{
throw
new
RuntimeException
(
"Display language name"
+
" mismatch for \"en\". Returned name was"
+
" \""
+
result
+
"\", result(HOST): \""
+
hostResult
+
"\""
);
}
result
=
Locale
.
US
.
getDisplayCountry
(
Locale
.
ENGLISH
);
if
(
ver
>=
6.1
&&
!
"United States"
.
equals
(
result
))
{
throw
new
RuntimeException
(
"Windows locale name provider did not return expected localized country name for \"US\". Returned name was \""
+
result
+
"\""
);
if
(
ver
>=
6.1
)
{
result
=
Locale
.
US
.
getDisplayCountry
(
Locale
.
ENGLISH
);
hostResult
=
lnp
.
getDisplayCountry
(
Locale
.
US
.
getCountry
(),
Locale
.
ENGLISH
);
System
.
out
.
printf
(
" Display country name for"
+
" (en_US): result(HOST): \"%s\", returned: \"%s\"\n"
,
hostResult
,
result
);
if
(
result
==
null
||
hostResult
!=
null
&&
!
result
.
equals
(
hostResult
))
{
throw
new
RuntimeException
(
"Display country name"
+
" mismatch for \"US\". Returned name was"
+
" \""
+
result
+
"\", result(HOST): \""
+
hostResult
+
"\""
);
}
}
}
else
{
throw
new
RuntimeException
(
"Windows Host LocaleProviderAdapter was not selected for English locale."
);
throw
new
RuntimeException
(
"Windows Host"
+
" LocaleProviderAdapter was not selected for"
+
" English locale."
);
}
}
}
catch
(
ParseException
pe
)
{
...
...
test/java/util/Locale/LocaleProviders.sh
浏览文件 @
71006342
...
...
@@ -24,7 +24,7 @@
#
# @test
# @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8010666
# 8013086
# 8013086
8013233
# @summary tests for "java.locale.providers" system property
# @compile -XDignore.symbol.file LocaleProviders.java
# @run shell/timeout=600 LocaleProviders.sh
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录