Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6f11d120
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看板
提交
6f11d120
编写于
3月 03, 2011
作者:
M
michaelm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7018606: (process) test/java/lang/ProcessBuilder/Basic.java failing intermittently (win)
Reviewed-by: alanb
上级
80aee3ba
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
6 deletion
+30
-6
test/java/lang/ProcessBuilder/Basic.java
test/java/lang/ProcessBuilder/Basic.java
+30
-6
未找到文件。
test/java/lang/ProcessBuilder/Basic.java
浏览文件 @
6f11d120
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
* @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689
* @bug 4199068 4738465 4937983 4930681 4926230 4931433 4932663 4986689
* 5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313
* 5026830 5023243 5070673 4052517 4811767 6192449 6397034 6413313
* 6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
* 6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
* 4947220
* 4947220
7018606
* @summary Basic tests for Process and Environment Variable code
* @summary Basic tests for Process and Environment Variable code
* @run main/othervm/timeout=300 Basic
* @run main/othervm/timeout=300 Basic
* @author Martin Buchholz
* @author Martin Buchholz
...
@@ -47,6 +47,9 @@ import static java.util.AbstractMap.SimpleImmutableEntry;
...
@@ -47,6 +47,9 @@ import static java.util.AbstractMap.SimpleImmutableEntry;
public
class
Basic
{
public
class
Basic
{
/* used for Windows only */
static
final
String
systemRoot
=
System
.
getenv
(
"SystemRoot"
);
private
static
String
commandOutput
(
Reader
r
)
throws
Throwable
{
private
static
String
commandOutput
(
Reader
r
)
throws
Throwable
{
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
int
c
;
int
c
;
...
@@ -1073,7 +1076,11 @@ public class Basic {
...
@@ -1073,7 +1076,11 @@ public class Basic {
try
{
try
{
ProcessBuilder
pb
=
new
ProcessBuilder
();
ProcessBuilder
pb
=
new
ProcessBuilder
();
pb
.
environment
().
clear
();
pb
.
environment
().
clear
();
equal
(
getenvInChild
(
pb
),
""
);
String
expected
=
Windows
.
is
()
?
"SystemRoot="
+
systemRoot
+
","
:
""
;
if
(
Windows
.
is
())
{
pb
.
environment
().
put
(
"SystemRoot"
,
systemRoot
);
}
equal
(
getenvInChild
(
pb
),
expected
);
}
catch
(
Throwable
t
)
{
unexpected
(
t
);
}
}
catch
(
Throwable
t
)
{
unexpected
(
t
);
}
//----------------------------------------------------------------
//----------------------------------------------------------------
...
@@ -1561,13 +1568,21 @@ public class Basic {
...
@@ -1561,13 +1568,21 @@ public class Basic {
List
<
String
>
childArgs
=
new
ArrayList
<
String
>(
javaChildArgs
);
List
<
String
>
childArgs
=
new
ArrayList
<
String
>(
javaChildArgs
);
childArgs
.
add
(
"System.getenv()"
);
childArgs
.
add
(
"System.getenv()"
);
String
[]
cmdp
=
childArgs
.
toArray
(
new
String
[
childArgs
.
size
()]);
String
[]
cmdp
=
childArgs
.
toArray
(
new
String
[
childArgs
.
size
()]);
String
[]
envp
=
{
"=ExitValue=3"
,
"=C:=\\"
};
String
[]
envp
;
String
[]
envpWin
=
{
"=ExitValue=3"
,
"=C:=\\"
,
"SystemRoot="
+
systemRoot
};
String
[]
envpOth
=
{
"=ExitValue=3"
,
"=C:=\\"
};
if
(
Windows
.
is
())
{
envp
=
envpWin
;
}
else
{
envp
=
envpOth
;
}
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmdp
,
envp
);
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmdp
,
envp
);
String
expected
=
Windows
.
is
()
?
"=C:=\\,=ExitValue=3,"
:
"=C:=\\,"
;
String
expected
=
Windows
.
is
()
?
"=C:=\\,
SystemRoot="
+
systemRoot
+
",
=ExitValue=3,"
:
"=C:=\\,"
;
equal
(
commandOutput
(
p
),
expected
);
equal
(
commandOutput
(
p
),
expected
);
if
(
Windows
.
is
())
{
if
(
Windows
.
is
())
{
ProcessBuilder
pb
=
new
ProcessBuilder
(
childArgs
);
ProcessBuilder
pb
=
new
ProcessBuilder
(
childArgs
);
pb
.
environment
().
clear
();
pb
.
environment
().
clear
();
pb
.
environment
().
put
(
"SystemRoot"
,
systemRoot
);
pb
.
environment
().
put
(
"=ExitValue"
,
"3"
);
pb
.
environment
().
put
(
"=ExitValue"
,
"3"
);
pb
.
environment
().
put
(
"=C:"
,
"\\"
);
pb
.
environment
().
put
(
"=C:"
,
"\\"
);
equal
(
commandOutput
(
pb
),
expected
);
equal
(
commandOutput
(
pb
),
expected
);
...
@@ -1591,10 +1606,18 @@ public class Basic {
...
@@ -1591,10 +1606,18 @@ public class Basic {
List
<
String
>
childArgs
=
new
ArrayList
<
String
>(
javaChildArgs
);
List
<
String
>
childArgs
=
new
ArrayList
<
String
>(
javaChildArgs
);
childArgs
.
add
(
"System.getenv()"
);
childArgs
.
add
(
"System.getenv()"
);
String
[]
cmdp
=
childArgs
.
toArray
(
new
String
[
childArgs
.
size
()]);
String
[]
cmdp
=
childArgs
.
toArray
(
new
String
[
childArgs
.
size
()]);
String
[]
envp
=
{
"LC_ALL=C\u0000\u0000"
,
// Yuck!
String
[]
envp
Win
=
{
"SystemRoot="
+
systemRoot
,
"LC_ALL=C\u0000\u0000"
,
// Yuck!
"FO\u0000=B\u0000R"
};
"FO\u0000=B\u0000R"
};
String
[]
envpOth
=
{
"LC_ALL=C\u0000\u0000"
,
// Yuck!
"FO\u0000=B\u0000R"
};
String
[]
envp
;
if
(
Windows
.
is
())
{
envp
=
envpWin
;
}
else
{
envp
=
envpOth
;
}
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmdp
,
envp
);
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmdp
,
envp
);
check
(
commandOutput
(
p
).
equals
(
"LC_ALL=C,"
),
check
(
commandOutput
(
p
).
equals
(
Windows
.
is
()
?
"SystemRoot="
+
systemRoot
+
",LC_ALL=C,"
:
"LC_ALL=C,"
),
"Incorrect handling of envstrings containing NULs"
);
"Incorrect handling of envstrings containing NULs"
);
}
catch
(
Throwable
t
)
{
unexpected
(
t
);
}
}
catch
(
Throwable
t
)
{
unexpected
(
t
);
}
...
@@ -2144,6 +2167,7 @@ public class Basic {
...
@@ -2144,6 +2167,7 @@ public class Basic {
static
void
equal
(
Object
x
,
Object
y
)
{
static
void
equal
(
Object
x
,
Object
y
)
{
if
(
x
==
null
?
y
==
null
:
x
.
equals
(
y
))
pass
();
if
(
x
==
null
?
y
==
null
:
x
.
equals
(
y
))
pass
();
else
fail
(
x
+
" not equal to "
+
y
);}
else
fail
(
x
+
" not equal to "
+
y
);}
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
try
{
realMain
(
args
);}
catch
(
Throwable
t
)
{
unexpected
(
t
);}
try
{
realMain
(
args
);}
catch
(
Throwable
t
)
{
unexpected
(
t
);}
System
.
out
.
printf
(
"%nPassed = %d, failed = %d%n%n"
,
passed
,
failed
);
System
.
out
.
printf
(
"%nPassed = %d, failed = %d%n%n"
,
passed
,
failed
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录