Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
332bce5b
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
332bce5b
编写于
11月 13, 2013
作者:
E
egahlin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6959636: testcase failing on windows javax/management/loading/LibraryLoader/LibraryLoaderTest.java
Reviewed-by: sla, jbachorik
上级
090aaac3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
73 deletion
+60
-73
test/ProblemList.txt
test/ProblemList.txt
+0
-3
test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
...x/management/loading/LibraryLoader/LibraryLoaderTest.java
+60
-70
未找到文件。
test/ProblemList.txt
浏览文件 @
332bce5b
...
@@ -139,9 +139,6 @@ sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java macosx-all
...
@@ -139,9 +139,6 @@ sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java macosx-all
# jdk_jmx
# jdk_jmx
# 6959636
javax/management/loading/LibraryLoader/LibraryLoaderTest.java windows-all
############################################################################
############################################################################
# jdk_math
# jdk_math
...
...
test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
浏览文件 @
332bce5b
/*
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004,
2013
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
* @author Luis-Miguel Alventosa
* @author Luis-Miguel Alventosa
* @run clean LibraryLoaderTest
* @run clean LibraryLoaderTest
* @run build LibraryLoaderTest
* @run build LibraryLoaderTest
* @run main LibraryLoaderTest
* @run main
/othervm
LibraryLoaderTest
*/
*/
import
java.io.File
;
import
java.io.File
;
...
@@ -48,7 +48,7 @@ public class LibraryLoaderTest {
...
@@ -48,7 +48,7 @@ public class LibraryLoaderTest {
{
"testDomain:type=MLet,index=1"
,
"UseNativeLib1.html"
}
{
"testDomain:type=MLet,index=1"
,
"UseNativeLib1.html"
}
};
};
public
static
void
main
(
String
args
[])
{
public
static
void
main
(
String
args
[])
throws
Exception
{
String
osName
=
System
.
getProperty
(
"os.name"
);
String
osName
=
System
.
getProperty
(
"os.name"
);
System
.
out
.
println
(
"os.name="
+
osName
);
System
.
out
.
println
(
"os.name="
+
osName
);
...
@@ -83,83 +83,73 @@ public class LibraryLoaderTest {
...
@@ -83,83 +83,73 @@ public class LibraryLoaderTest {
"file:/"
+
testSrc
.
replace
(
File
.
separatorChar
,
'/'
)
+
"/"
;
"file:/"
+
testSrc
.
replace
(
File
.
separatorChar
,
'/'
)
+
"/"
;
}
}
try
{
// Create MBeanServer
// Create MBeanServer
//
MBeanServer
server
=
MBeanServerFactory
.
newMBeanServer
();
// Create MLet instances and call getRandom on the loaded MBeans
//
for
(
int
i
=
0
;
i
<
mletInfo
.
length
;
i
++)
{
// Create ObjectName for MLet
//
//
MBeanServer
server
=
MBeanServerFactory
.
newMBeanServer
();
ObjectName
mlet
=
new
ObjectName
(
mletInfo
[
i
][
0
]);
server
.
createMBean
(
"javax.management.loading.MLet"
,
mlet
);
System
.
out
.
println
(
"MLet = "
+
mlet
);
//
Create MLet instances and call getRandom on the loaded MBean
s
//
Display old library directory and set it to test.classe
s
//
//
for
(
int
i
=
0
;
i
<
mletInfo
.
length
;
i
++)
{
String
libraryDirectory
=
// Create ObjectName for MLet
(
String
)
server
.
getAttribute
(
mlet
,
"LibraryDirectory"
);
//
System
.
out
.
println
(
"Old Library Directory = "
+
ObjectName
mlet
=
new
ObjectName
(
mletInfo
[
i
][
0
]);
libraryDirectory
);
server
.
createMBean
(
"javax.management.loading.MLet"
,
mlet
);
Attribute
attribute
=
System
.
out
.
println
(
"MLet = "
+
mlet
);
new
Attribute
(
"LibraryDirectory"
,
workingDir
);
server
.
setAttribute
(
mlet
,
attribute
);
libraryDirectory
=
(
String
)
server
.
getAttribute
(
mlet
,
"LibraryDirectory"
);
System
.
out
.
println
(
"New Library Directory = "
+
libraryDirectory
);
// Display old library directory and set it to test.classes
// Get MBeans from URL
//
//
String
libraryDirectory
=
String
mletURL
=
urlCodebase
+
mletInfo
[
i
][
1
];
(
String
)
server
.
getAttribute
(
mlet
,
"LibraryDirectory"
);
System
.
out
.
println
(
"MLet URL = "
+
mletURL
);
System
.
out
.
println
(
"Old Library Directory = "
+
Object
[]
params
=
new
Object
[]
{
mletURL
};
libraryDirectory
);
String
[]
signature
=
new
String
[]
{
"java.lang.String"
};
Attribute
attribute
=
Object
res
[]
=
((
Set
<?>)
server
.
invoke
(
mlet
,
new
Attribute
(
"LibraryDirectory"
,
workingDir
);
"getMBeansFromURL"
,
server
.
setAttribute
(
mlet
,
attribute
);
params
,
libraryDirectory
=
signature
)).
toArray
();
(
String
)
server
.
getAttribute
(
mlet
,
"LibraryDirectory"
);
System
.
out
.
println
(
"New Library Directory = "
+
libraryDirectory
);
// Get MBeans from URL
// Iterate through all the loaded MBeans
//
for
(
int
j
=
0
;
j
<
res
.
length
;
j
++)
{
// Now ensure none of the returned objects is a Throwable
//
//
String
mletURL
=
urlCodebase
+
mletInfo
[
i
][
1
];
if
(
res
[
j
]
instanceof
Throwable
)
{
System
.
out
.
println
(
"MLet URL = "
+
mletURL
);
((
Throwable
)
res
[
j
]).
printStackTrace
(
System
.
out
);
Object
[]
params
=
new
Object
[]
{
mletURL
};
throw
new
Exception
(
"Failed to load the MBean #"
+
j
String
[]
signature
=
new
String
[]
{
"java.lang.String"
};
,(
Throwable
)
res
[
j
]);
Object
res
[]
=
((
Set
)
server
.
invoke
(
mlet
,
}
"getMBeansFromURL"
,
params
,
signature
)).
toArray
();
// Iterate through all the loaded MBeans
// On each of the loaded MBeans, try to invoke their
// native operation
//
//
for
(
int
j
=
0
;
j
<
res
.
length
;
j
++)
{
Object
result
=
null
;
// Now ensure none of the returned objects is a Throwable
try
{
//
ObjectName
mbean
=
if
(
res
[
j
]
instanceof
Throwable
)
{
((
ObjectInstance
)
res
[
j
]).
getObjectName
();
((
Throwable
)
res
[
j
]).
printStackTrace
(
System
.
out
);
result
=
server
.
getAttribute
(
mbean
,
"Random"
);
System
.
out
.
println
(
"Failed to load the MBean #"
+
j
+
System
.
out
.
println
(
"MBean #"
+
j
+
" = "
+
mbean
);
". The shown Throwable was caught."
);
System
.
out
.
println
(
"Random number = "
+
result
);
System
.
exit
(
1
);
}
catch
(
ReflectionException
e
)
{
}
e
.
getTargetException
().
printStackTrace
(
System
.
out
);
throw
new
Exception
(
"A ReflectionException "
// On each of the loaded MBeans, try to invoke their
+
"occured when attempting to invoke "
// native operation
+
"a native library based operation."
,
//
e
.
getTargetException
());
Object
result
=
null
;
try
{
ObjectName
mbean
=
((
ObjectInstance
)
res
[
j
]).
getObjectName
();
result
=
server
.
getAttribute
(
mbean
,
"Random"
);
System
.
out
.
println
(
"MBean #"
+
j
+
" = "
+
mbean
);
System
.
out
.
println
(
"Random number = "
+
result
);
}
catch
(
ReflectionException
e
)
{
e
.
getTargetException
().
printStackTrace
(
System
.
out
);
System
.
out
.
println
(
"A ReflectionException, wrapping "
+
"the shown exception, occured when"
+
" attempting to invoke a native "
+
"library based operation."
);
System
.
exit
(
1
);
}
}
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
System
.
out
);
System
.
out
.
println
(
e
.
getMessage
());
System
.
out
.
println
(
"Unexpected error"
);
System
.
exit
(
1
);
}
}
System
.
out
.
println
(
"Bye! Bye!"
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录