Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
74060bdc
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看板
提交
74060bdc
编写于
12月 04, 2012
作者:
J
jgish
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8003596: TEST_BUG: java/util/logging/CheckLockLocationTest.java failing [win]
Reviewed-by: alanb
上级
4f1534c2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
19 deletion
+33
-19
test/ProblemList.txt
test/ProblemList.txt
+0
-3
test/java/util/logging/CheckLockLocationTest.java
test/java/util/logging/CheckLockLocationTest.java
+33
-16
未找到文件。
test/ProblemList.txt
浏览文件 @
74060bdc
...
...
@@ -363,9 +363,6 @@ java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all
# Filed 6772009
java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
# 8003596
java/util/logging/CheckLockLocationTest.java windows-all
# 7041639, Solaris DSA keypair generation bug
java/util/TimeZone/TimeZoneDatePermissionCheck.sh solaris-all
...
...
test/java/util/logging/CheckLockLocationTest.java
浏览文件 @
74060bdc
...
...
@@ -42,17 +42,22 @@ public class CheckLockLocationTest {
private
static
final
String
NOT_A_DIR
=
"not-a-dir"
;
private
static
final
String
WRITABLE_DIR
=
"writable-dir"
;
private
static
final
String
NON_EXISTENT_DIR
=
"non-existent-dir"
;
private
static
boolean
runNonWritableDirTest
;
public
static
void
main
(
String
...
args
)
throws
IOException
{
// we'll base all file creation attempts on the system temp directory,
// %t and also try specifying non-existent directories and plain files
// that should be directories, and non-writable directories,
// to exercise all code paths of checking the lock location
// Note that on platforms like Windows that don't support
// setWritable() on a directory, we'll skip the non-writable
// directory test if setWritable(false) returns false.
//
File
writableDir
=
setup
();
// we now have three files/directories to work with:
// writableDir
// notAdir
// nonWritableDir
// nonWritableDir
(may not be possible on some platforms)
// nonExistentDir (which doesn't exist)
runTests
(
writableDir
);
}
...
...
@@ -79,15 +84,19 @@ public class CheckLockLocationTest {
}
// Test 2: creating FileHandler in non-writable directory should fail
try
{
new
FileHandler
(
"%t/"
+
NON_WRITABLE_DIR
+
"/log.log"
);
throw
new
RuntimeException
(
"Test failed: should not have been able"
+
" to create FileHandler for "
+
"%t/"
+
NON_WRITABLE_DIR
+
"/log.log in non-writable directory."
);
}
catch
(
IOException
ex
)
{
// check for the right exception
if
(!(
ex
instanceof
AccessDeniedException
))
{
throw
new
RuntimeException
(
"Test failed: Expected exception was not an AccessDeniedException"
,
ex
);
if
(
runNonWritableDirTest
)
{
try
{
new
FileHandler
(
"%t/"
+
NON_WRITABLE_DIR
+
"/log.log"
);
throw
new
RuntimeException
(
"Test failed: should not have been able"
+
" to create FileHandler for "
+
"%t/"
+
NON_WRITABLE_DIR
+
"/log.log in non-writable directory."
);
}
catch
(
IOException
ex
)
{
// check for the right exception
if
(!(
ex
instanceof
AccessDeniedException
))
{
throw
new
RuntimeException
(
"Test failed: Expected exception was not an "
+
"AccessDeniedException"
,
ex
);
}
}
}
...
...
@@ -99,8 +108,11 @@ public class CheckLockLocationTest {
+
"/log.log in non-directory."
);
}
catch
(
IOException
ex
)
{
// check for the right exception
if
(!(
ex
instanceof
FileSystemException
&&
ex
.
getMessage
().
contains
(
"Not a directory"
)))
{
throw
new
RuntimeException
(
"Test failed: Expected exception was not a FileSystemException"
,
ex
);
if
(!(
ex
instanceof
FileSystemException
&&
ex
.
getMessage
().
contains
(
"Not a directory"
)))
{
throw
new
RuntimeException
(
"Test failed: Expected exception was not a "
+
"FileSystemException"
,
ex
);
}
}
...
...
@@ -113,7 +125,8 @@ public class CheckLockLocationTest {
}
catch
(
IOException
ex
)
{
// check for the right exception
if
(!(
ex
instanceof
NoSuchFileException
))
{
throw
new
RuntimeException
(
"Test failed: Expected exception was not a NoSuchFileException"
,
ex
);
throw
new
RuntimeException
(
"Test failed: Expected exception "
+
"was not a NoSuchFileException"
,
ex
);
}
}
}
...
...
@@ -162,10 +175,14 @@ public class CheckLockLocationTest {
nonWritableDir
.
deleteOnExit
();
// make it non-writable
if
(!
nonWritableDir
.
setWritable
(
false
))
{
throw
new
RuntimeException
(
"Test setup failed: unable to make"
if
(
nonWritableDir
.
setWritable
(
false
))
{
runNonWritableDirTest
=
true
;
}
else
{
runNonWritableDirTest
=
false
;
System
.
out
.
println
(
"Test Setup WARNING: unable to make"
+
" working directory "
+
nonWritableDir
.
getAbsolutePath
()
+
" non-writable."
);
+
" non-writable on platform "
+
System
.
getProperty
(
"os.name"
));
}
// make sure non-existent directory really doesn't exist
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录