Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
54314fe7
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看板
提交
54314fe7
编写于
11月 19, 2013
作者:
V
vinnie
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e47ffa50
4b7a613d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
128 addition
and
34 deletion
+128
-34
test/Makefile
test/Makefile
+1
-1
test/ProblemList.txt
test/ProblemList.txt
+3
-3
test/java/lang/ProcessBuilder/Basic.java
test/java/lang/ProcessBuilder/Basic.java
+2
-0
test/java/rmi/testlibrary/TestLibrary.java
test/java/rmi/testlibrary/TestLibrary.java
+28
-1
test/lib/testlibrary/jdk/testlibrary/FileUtils.java
test/lib/testlibrary/jdk/testlibrary/FileUtils.java
+25
-0
test/tools/jar/JarEntryTime.java
test/tools/jar/JarEntryTime.java
+26
-16
test/tools/launcher/ExecutionEnvironment.java
test/tools/launcher/ExecutionEnvironment.java
+8
-11
test/tools/launcher/Test7029048.java
test/tools/launcher/Test7029048.java
+4
-0
test/tools/launcher/TestHelper.java
test/tools/launcher/TestHelper.java
+31
-2
未找到文件。
test/Makefile
浏览文件 @
54314fe7
...
...
@@ -250,7 +250,7 @@ endef
# ------------------------------------------------------------------
jdk_%
:
jdk_%
core_% svc_%
:
$(ECHO)
"Running tests:
$@
"
for
each
in
$@
;
do
\
$(MAKE)
-j
1
TEST_SELECTION
=
":
$$
each"
UNIQUE_DIR
=
$$
each jtreg_tests
;
\
...
...
test/ProblemList.txt
浏览文件 @
54314fe7
...
...
@@ -176,9 +176,6 @@ com/sun/net/httpserver/bugs/6725892/Test.java generic-all
# Filed 7036666
com/sun/net/httpserver/Test9a.java generic-all
# 7102670
java/net/InetAddress/CheckJNI.java linux-all
# failing on vista 32/64 on nightly
# 7102702
java/net/PortUnreachableException/OneExceptionOnly.java windows-all
...
...
@@ -293,6 +290,9 @@ com/sun/tools/attach/BasicTests.sh generic-all
# 7132203
sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all
# 8028474
sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh generic-all
# Tests take too long, on sparcs see 7143279
tools/pack200/CommandLineTests.java solaris-all, macosx-all
tools/pack200/Pack200Test.java solaris-all, macosx-all
...
...
test/java/lang/ProcessBuilder/Basic.java
浏览文件 @
54314fe7
...
...
@@ -2016,6 +2016,7 @@ public class Basic {
&&
new
File
(
"/bin/bash"
).
exists
()
&&
new
File
(
"/bin/sleep"
).
exists
())
{
final
String
[]
cmd
=
{
"/bin/bash"
,
"-c"
,
"(/bin/sleep 6666)"
};
final
String
[]
cmdkill
=
{
"/bin/bash"
,
"-c"
,
"(/usr/bin/pkill -f \"sleep 6666\")"
};
final
ProcessBuilder
pb
=
new
ProcessBuilder
(
cmd
);
final
Process
p
=
pb
.
start
();
final
InputStream
stdout
=
p
.
getInputStream
();
...
...
@@ -2043,6 +2044,7 @@ public class Basic {
stdout
.
close
();
stderr
.
close
();
stdin
.
close
();
new
ProcessBuilder
(
cmdkill
).
start
();
//----------------------------------------------------------
// There remain unsolved issues with asynchronous close.
// Here's a highly non-portable experiment to demonstrate:
...
...
test/java/rmi/testlibrary/TestLibrary.java
浏览文件 @
54314fe7
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
3
, 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
...
...
@@ -127,6 +127,33 @@ public class TestLibrary {
bomb
(
null
,
e
);
}
/**
* Helper method to determine if registry has started
*
* @param port The port number to check
* @param msTimeout The amount of milliseconds to spend checking
*/
public
static
boolean
checkIfRegistryRunning
(
int
port
,
int
msTimeout
)
{
long
stopTime
=
System
.
currentTimeMillis
()
+
msTimeout
;
do
{
try
{
Registry
r
=
LocateRegistry
.
getRegistry
(
port
);
String
[]
s
=
r
.
list
();
// no exception. We're now happy that registry is running
return
true
;
}
catch
(
RemoteException
e
)
{
// problem - not ready ? Try again
try
{
Thread
.
sleep
(
500
);
}
catch
(
InterruptedException
ie
)
{
// not expected
}
}
}
while
(
stopTime
>
System
.
currentTimeMillis
());
return
false
;
}
public
static
String
getProperty
(
String
property
,
String
defaultVal
)
{
final
String
prop
=
property
;
final
String
def
=
defaultVal
;
...
...
test/lib/testlibrary/jdk/testlibrary/FileUtils.java
浏览文件 @
54314fe7
...
...
@@ -68,6 +68,31 @@ public final class FileUtils {
}
}
/**
* Deletes a file, retrying if necessary.
* No exception thrown if file doesn't exist.
*
* @param path the file to delete
*
* @throws NoSuchFileException
* if the file does not exist (optional specific exception)
* @throws DirectoryNotEmptyException
* if the file is a directory and could not otherwise be deleted
* because the directory is not empty (optional specific exception)
* @throws IOException
* if an I/O error occurs
*/
public
static
void
deleteFileIfExistsWithRetry
(
Path
path
)
throws
IOException
{
try
{
if
(
Files
.
exists
(
path
))
deleteFileWithRetry0
(
path
);
}
catch
(
InterruptedException
x
)
{
throw
new
IOException
(
"Interrupted while deleting."
,
x
);
}
}
private
static
void
deleteFileWithRetry0
(
Path
path
)
throws
IOException
,
InterruptedException
{
...
...
test/tools/jar/JarEntryTime.java
浏览文件 @
54314fe7
...
...
@@ -29,10 +29,15 @@
import
java.io.File
;
import
java.io.PrintWriter
;
import
java.
util.Dat
e
;
import
java.
nio.file.attribute.FileTim
e
;
import
sun.tools.jar.Main
;
public
class
JarEntryTime
{
// ZipEntry's mod date has 2 seconds precision: give extra time to
// allow for e.g. rounding/truncation and networked/samba drives.
static
final
long
PRECISION
=
10000L
;
static
boolean
cleanup
(
File
dir
)
throws
Throwable
{
boolean
rc
=
true
;
File
[]
x
=
dir
.
listFiles
();
...
...
@@ -88,9 +93,9 @@ public class JarEntryTime {
check
(
dirOuter
.
mkdir
());
check
(
dirInner
.
mkdir
());
File
fileInner
=
new
File
(
dirInner
,
"foo.txt"
);
PrintWriter
pw
=
new
PrintWriter
(
fileInner
);
pw
.
println
(
"hello, world"
);
pw
.
close
();
try
(
PrintWriter
pw
=
new
PrintWriter
(
fileInner
))
{
pw
.
println
(
"hello, world"
);
}
// Get the "now" from the "last-modified-time" of the last file we
// just created, instead of the "System.currentTimeMillis()", to
...
...
@@ -98,13 +103,10 @@ public class JarEntryTime {
final
long
now
=
fileInner
.
lastModified
();
final
long
earlier
=
now
-
(
60L
*
60L
*
6L
*
1000L
);
final
long
yesterday
=
now
-
(
60L
*
60L
*
24L
*
1000L
);
// ZipEntry's mod date has 2 seconds precision: give extra time to
// allow for e.g. rounding/truncation and networked/samba drives.
final
long
PRECISION
=
10000L
;
dirOuter
.
setLastModified
(
now
);
dirInner
.
setLastModified
(
yesterday
);
fileInner
.
setLastModified
(
earlier
);
check
(
dirOuter
.
setLastModified
(
now
)
);
check
(
dirInner
.
setLastModified
(
yesterday
)
);
check
(
fileInner
.
setLastModified
(
earlier
)
);
// Make a jar file from that directory structure
Main
jartool
=
new
Main
(
System
.
out
,
System
.
err
,
"jar"
);
...
...
@@ -122,9 +124,9 @@ public class JarEntryTime {
check
(
dirOuter
.
exists
());
check
(
dirInner
.
exists
());
check
(
fileInner
.
exists
());
check
(
Math
.
abs
(
dirOuter
.
lastModified
()
-
now
)
<=
PRECISION
);
check
(
Math
.
abs
(
dirInner
.
lastModified
()
-
yesterday
)
<=
PRECISION
);
check
(
Math
.
abs
(
fileInner
.
lastModified
()
-
earlier
)
<=
PRECISION
);
check
FileTime
(
dirOuter
.
lastModified
(),
now
);
check
FileTime
(
dirInner
.
lastModified
(),
yesterday
);
check
FileTime
(
fileInner
.
lastModified
(),
earlier
);
check
(
cleanup
(
dirInner
));
check
(
cleanup
(
dirOuter
));
...
...
@@ -135,9 +137,9 @@ public class JarEntryTime {
check
(
dirOuter
.
exists
());
check
(
dirInner
.
exists
());
check
(
fileInner
.
exists
());
check
(
Math
.
abs
(
dirOuter
.
lastModified
()
-
now
)
<=
PRECISION
);
check
(
Math
.
abs
(
dirInner
.
lastModified
()
-
now
)
<=
PRECISION
);
check
(
Math
.
abs
(
fileInner
.
lastModified
()
-
now
)
<=
PRECISION
);
check
FileTime
(
dirOuter
.
lastModified
(),
now
);
check
FileTime
(
dirInner
.
lastModified
(),
now
);
check
FileTime
(
fileInner
.
lastModified
(),
now
);
check
(
cleanup
(
dirInner
));
check
(
cleanup
(
dirOuter
));
...
...
@@ -145,6 +147,14 @@ public class JarEntryTime {
check
(
jarFile
.
delete
());
}
static
void
checkFileTime
(
long
now
,
long
original
)
{
if
(
Math
.
abs
(
now
-
original
)
>
PRECISION
)
{
System
.
out
.
format
(
"Extracted to %s, expected to be close to %s%n"
,
FileTime
.
fromMillis
(
now
),
FileTime
.
fromMillis
(
original
));
fail
();
}
}
//--------------------- Infrastructure ---------------------------
static
volatile
int
passed
=
0
,
failed
=
0
;
static
void
pass
()
{
passed
++;}
...
...
test/tools/launcher/ExecutionEnvironment.java
浏览文件 @
54314fe7
...
...
@@ -89,10 +89,6 @@ public class ExecutionEnvironment extends TestHelper {
static
final
File
testJarFile
=
new
File
(
"EcoFriendly.jar"
);
static
final
String
LIBJVM
=
TestHelper
.
isWindows
?
"jvm.dll"
:
"libjvm"
+
(
TestHelper
.
isMacOSX
?
".dylib"
:
".so"
);
public
ExecutionEnvironment
()
{
createTestJar
();
}
...
...
@@ -192,7 +188,7 @@ public class ExecutionEnvironment extends TestHelper {
tr
=
doExec
(
env
,
javaCmd
,
"-jar"
,
testJarFile
.
getAbsolutePath
());
verifyJavaLibraryPathGeneric
(
tr
);
}
else
{
}
else
{
// Solaris
// no override
env
.
clear
();
env
.
put
(
LD_LIBRARY_PATH
,
LD_LIBRARY_PATH_VALUE
);
...
...
@@ -236,23 +232,24 @@ public class ExecutionEnvironment extends TestHelper {
}
/*
* ensures we have indeed exec'ed the correct vm of choice, all VMs support
* -server, however 32-bit VMs support -client and -server.
* ensures we have indeed exec'ed the correct vm of choice if it exists
*/
@Test
void
testVmSelection
()
{
TestResult
tr
=
null
;
if
(
is32Bit
)
{
if
(
haveClientVM
)
{
tr
=
doExec
(
javaCmd
,
"-client"
,
"-version"
);
if
(!
tr
.
matches
(
".*Client VM.*"
))
{
flagError
(
tr
,
"the expected vm -client did not launch"
);
}
}
tr
=
doExec
(
javaCmd
,
"-server"
,
"-version"
);
if
(!
tr
.
matches
(
".*Server VM.*"
))
{
flagError
(
tr
,
"the expected vm -server did not launch"
);
if
(
haveServerVM
)
{
tr
=
doExec
(
javaCmd
,
"-server"
,
"-version"
);
if
(!
tr
.
matches
(
".*Server VM.*"
))
{
flagError
(
tr
,
"the expected vm -server did not launch"
);
}
}
}
...
...
test/tools/launcher/Test7029048.java
浏览文件 @
54314fe7
...
...
@@ -208,6 +208,10 @@ public class Test7029048 extends TestHelper {
System
.
out
.
println
(
"Note: applicable on neither Windows nor MacOSX"
);
return
;
}
if
(!
TestHelper
.
haveServerVM
)
{
System
.
out
.
println
(
"Note: test relies on server vm, not found, exiting"
);
return
;
}
// create our test jar first
ExecutionEnvironment
.
createTestJar
();
...
...
test/tools/launcher/TestHelper.java
浏览文件 @
54314fe7
...
...
@@ -67,11 +67,15 @@ public class TestHelper {
static
final
String
JAVAHOME
=
System
.
getProperty
(
"java.home"
);
static
final
String
JAVA_BIN
;
static
final
String
JAVA_JRE_BIN
;
static
final
String
JAVA_LIB
;
static
final
String
JAVA_JRE_LIB
;
static
final
boolean
isSDK
=
JAVAHOME
.
endsWith
(
"jre"
);
static
final
String
javaCmd
;
static
final
String
javawCmd
;
static
final
String
javacCmd
;
static
final
String
jarCmd
;
static
final
boolean
haveServerVM
;
static
final
boolean
haveClientVM
;
static
final
JavaCompiler
compiler
;
...
...
@@ -88,6 +92,9 @@ public class TestHelper {
System
.
getProperty
(
"os.name"
,
"unknown"
).
startsWith
(
"SunOS"
);
static
final
boolean
isLinux
=
System
.
getProperty
(
"os.name"
,
"unknown"
).
startsWith
(
"Linux"
);
static
final
String
LIBJVM
=
isWindows
?
"jvm.dll"
:
"libjvm"
+
(
isMacOSX
?
".dylib"
:
".so"
);
static
final
boolean
isSparc
=
System
.
getProperty
(
"os.arch"
).
startsWith
(
"sparc"
);
...
...
@@ -124,12 +131,19 @@ public class TestHelper {
throw
new
RuntimeException
(
"arch model is not 32 or 64 bit ?"
);
}
compiler
=
ToolProvider
.
getSystemJavaCompiler
();
File
binDir
=
(
isSDK
)
?
new
File
((
new
File
(
JAVAHOME
)).
getParentFile
(),
"bin"
)
:
new
File
(
JAVAHOME
,
"bin"
);
JAVA_BIN
=
binDir
.
getAbsolutePath
();
JAVA_JRE_BIN
=
new
File
((
new
File
(
JAVAHOME
)).
getParentFile
(),
(
isSDK
)
?
"jre/bin"
:
"bin"
).
getAbsolutePath
();
JAVA_JRE_BIN
=
new
File
(
JAVAHOME
,
"bin"
).
getAbsolutePath
();
File
libDir
=
(
isSDK
)
?
new
File
((
new
File
(
JAVAHOME
)).
getParentFile
(),
"lib"
)
:
new
File
(
JAVAHOME
,
"lib"
);
JAVA_LIB
=
libDir
.
getAbsolutePath
();
JAVA_JRE_LIB
=
new
File
(
JAVAHOME
,
"lib"
).
getAbsolutePath
();
File
javaCmdFile
=
(
isWindows
)
?
new
File
(
binDir
,
"java.exe"
)
:
new
File
(
binDir
,
"java"
);
...
...
@@ -168,6 +182,21 @@ public class TestHelper {
throw
new
RuntimeException
(
"java <"
+
javacCmd
+
"> must exist and should be executable"
);
}
haveClientVM
=
haveVmVariant
(
"client"
);
haveServerVM
=
haveVmVariant
(
"server"
);
}
private
static
boolean
haveVmVariant
(
String
type
)
{
if
(
isWindows
)
{
File
vmDir
=
new
File
(
JAVA_JRE_BIN
,
type
);
File
jvmFile
=
new
File
(
vmDir
,
LIBJVM
);
return
jvmFile
.
exists
();
}
else
{
File
vmDir
=
new
File
(
JAVA_JRE_LIB
,
type
);
File
vmArchDir
=
new
File
(
vmDir
,
getJreArch
());
File
jvmFile
=
new
File
(
vmArchDir
,
LIBJVM
);
return
jvmFile
.
exists
();
}
}
void
run
(
String
[]
args
)
throws
Exception
{
int
passed
=
0
,
failed
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录