Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ce2d77f5
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看板
提交
ce2d77f5
编写于
2月 27, 2013
作者:
S
sundar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8009140: jtreg tests under sun/tools/jrunscript should use nashorn engine
Reviewed-by: alanb
上级
66b7140e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
16 addition
and
56 deletion
+16
-56
test/sun/tools/jrunscript/CheckEngine.java
test/sun/tools/jrunscript/CheckEngine.java
+1
-1
test/sun/tools/jrunscript/jrunscript-DTest.sh
test/sun/tools/jrunscript/jrunscript-DTest.sh
+1
-1
test/sun/tools/jrunscript/jrunscript-argsTest.sh
test/sun/tools/jrunscript/jrunscript-argsTest.sh
+1
-1
test/sun/tools/jrunscript/jrunscript-cpTest.sh
test/sun/tools/jrunscript/jrunscript-cpTest.sh
+2
-2
test/sun/tools/jrunscript/jrunscript-eTest.sh
test/sun/tools/jrunscript/jrunscript-eTest.sh
+1
-12
test/sun/tools/jrunscript/jrunscript-fTest.sh
test/sun/tools/jrunscript/jrunscript-fTest.sh
+1
-12
test/sun/tools/jrunscript/jrunscriptTest.sh
test/sun/tools/jrunscript/jrunscriptTest.sh
+2
-20
test/sun/tools/jrunscript/repl.out
test/sun/tools/jrunscript/repl.out
+7
-7
未找到文件。
test/sun/tools/jrunscript/CheckEngine.java
浏览文件 @
ce2d77f5
...
...
@@ -33,7 +33,7 @@ public class CheckEngine {
public
static
void
main
(
String
...
args
)
{
int
exitCode
=
0
;
ScriptEngine
engine
=
(
new
ScriptEngineManager
()).
getEngineByName
(
"
js
"
);
(
new
ScriptEngineManager
()).
getEngineByName
(
"
nashorn
"
);
if
(
engine
==
null
&&
!(
System
.
getProperty
(
"java.runtime.name"
).
startsWith
(
"Java(TM)"
)))
{
...
...
test/sun/tools/jrunscript/jrunscript-DTest.sh
浏览文件 @
ce2d77f5
...
...
@@ -43,7 +43,7 @@ fi
# to script as java.lang.System property. sysProps is
# jrunscript shell built-in variable for System properties.
${
JRUNSCRIPT
}
-Djrunscript
.foo
=
bar
<<
EOF
${
JRUNSCRIPT
}
-
l
nashorn
-
Djrunscript
.foo
=
bar
<<
EOF
if (sysProps["jrunscript.foo"] == "bar") { println("Passed"); exit(0); }
// unexpected value
println("Unexpected System property value");
...
...
test/sun/tools/jrunscript/jrunscript-argsTest.sh
浏览文件 @
ce2d77f5
...
...
@@ -41,7 +41,7 @@ fi
# we check whether "excess" args are passed as script arguments
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-f
- hello world
<<
EOF
${
JRUNSCRIPT
}
-
l
nashorn
-
J-Djava
.awt.headless
=
true
-f
- hello world
<<
EOF
if (typeof(arguments) == 'undefined') { println("arguments expected"); exit(1); }
...
...
test/sun/tools/jrunscript/jrunscript-cpTest.sh
浏览文件 @
ce2d77f5
...
...
@@ -46,7 +46,7 @@ ${JAVAC} ${TESTSRC}/Hello.java -d .
# work with jrunscript. Script should be able to
# access Java class "Hello".
${
JRUNSCRIPT
}
-cp
.
<<
EOF
${
JRUNSCRIPT
}
-
l
nashorn
-
cp
.
<<
EOF
var v;
try { v = new Packages.Hello(); } catch (e) { println(e); exit(1) }
if (v.string != 'hello') { println("Unexpected property value"); exit(1); }
...
...
@@ -58,7 +58,7 @@ fi
# -classpath and -cp are synonyms
${
JRUNSCRIPT
}
-classpath
.
<<
EOF
${
JRUNSCRIPT
}
-
l
nashorn
-
classpath
.
<<
EOF
var v;
try { v = new Packages.Hello(); } catch (e) { println(e); exit(1) }
if (v.string != 'hello') { println("unexpected property value"); exit(1); }
...
...
test/sun/tools/jrunscript/jrunscript-eTest.sh
浏览文件 @
ce2d77f5
...
...
@@ -39,21 +39,10 @@ if [ $? -eq 2 ]; then
exit
0
fi
rm
-f
jrunscript-eTest.out 2>/dev/null
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-e
"println('hello')"
>
jrunscript-eTest.out 2>&1
$golden_diff
jrunscript-eTest.out
${
TESTSRC
}
/dash-e.out
if
[
$?
!=
0
]
then
echo
"Output of jrunscript -e differ from expected output. Failed."
rm
-f
jrunscript-eTest.out 2>/dev/null
exit
1
fi
# -e option with JavaScript explicitly choosen as language
rm
-f
jrunscript-eTest.out 2>/dev/null
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-l
js
-e
"println('hello')"
>
jrunscript-eTest.out 2>&1
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-l
nashorn
-e
"println('hello')"
>
jrunscript-eTest.out 2>&1
$golden_diff
jrunscript-eTest.out
${
TESTSRC
}
/dash-e.out
if
[
$?
!=
0
]
...
...
test/sun/tools/jrunscript/jrunscript-fTest.sh
浏览文件 @
ce2d77f5
...
...
@@ -39,22 +39,11 @@ if [ $? -eq 2 ]; then
exit
0
fi
rm
-f
jrunscript-fTest.out 2>/dev/null
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-f
${
TESTSRC
}
/hello.js
>
jrunscript-fTest.out 2>&1
$golden_diff
jrunscript-fTest.out
${
TESTSRC
}
/dash-f.out
if
[
$?
!=
0
]
then
echo
"Output of jrunscript -f differ from expected output. Failed."
rm
-f
jrunscript-fTest.out 2>/dev/null
exit
1
fi
# -f option used with JavaScript as language chosen explicitly
# with -l option
rm
-f
jrunscript-fTest.out 2>/dev/null
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-l
js
-f
${
TESTSRC
}
/hello.js
>
jrunscript-fTest.out 2>&1
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-l
nashorn
-f
${
TESTSRC
}
/hello.js
>
jrunscript-fTest.out 2>&1
$golden_diff
jrunscript-fTest.out
${
TESTSRC
}
/dash-f.out
if
[
$?
!=
0
]
...
...
test/sun/tools/jrunscript/jrunscriptTest.sh
浏览文件 @
ce2d77f5
...
...
@@ -40,7 +40,7 @@ if [ $? -eq 2 ]; then
fi
rm
-f
jrunscriptTest.out 2>/dev/null
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
>
jrunscriptTest.out 2>&1
<<
EOF
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-l
nashorn
>
jrunscriptTest.out 2>&1
<<
EOF
v = 2 + 5;
v *= 5;
v = v + " is the value";
...
...
@@ -52,25 +52,7 @@ EOF
$golden_diff
jrunscriptTest.out
${
TESTSRC
}
/repl.out
if
[
$?
!=
0
]
then
echo
"Output of jrunscript session differ from expected output. Failed."
rm
-f
jrunscriptTest.out 2>/dev/null
exit
1
fi
rm
-f
jrunscriptTest.out 2>/dev/null
${
JRUNSCRIPT
}
-J-Djava
.awt.headless
=
true
-l
js
>
jrunscriptTest.out 2>&1
<<
EOF
v = 2 + 5;
v *= 5;
v = v + " is the value";
if (v != 0) { println('yes v != 0'); }
java.lang.System.out.println('hello world from script');
new java.lang.Runnable() { run: function() { println('I am runnable'); }}.run();
EOF
$golden_diff
jrunscriptTest.out
${
TESTSRC
}
/repl.out
if
[
$?
!=
0
]
then
echo
"Output of jrunscript -l js differ from expected output. Failed."
echo
"Output of jrunscript -l nashorn differ from expected output. Failed."
rm
-f
jrunscriptTest.out 2>/dev/null
exit
1
fi
...
...
test/sun/tools/jrunscript/repl.out
浏览文件 @
ce2d77f5
js> 7.0
js> 35.0
js> 35 is the value
js> yes v != 0
js> hello world from script
js> I am runnable
js>
\ No newline at end of file
nashorn> 7
nashorn> 35.0
nashorn> 35 is the value
nashorn> yes v != 0
nashorn> hello world from script
nashorn> I am runnable
nashorn>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录