Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b036a7c2
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看板
提交
b036a7c2
编写于
8月 19, 2008
作者:
T
tbell
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
b5440dc5
904e3c09
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
213 addition
and
43 deletion
+213
-43
test/java/lang/management/ThreadMXBean/Locks.java
test/java/lang/management/ThreadMXBean/Locks.java
+6
-2
test/javax/script/E4XErrorTest.java
test/javax/script/E4XErrorTest.java
+4
-3
test/javax/script/Helper.java
test/javax/script/Helper.java
+41
-0
test/javax/script/JavaScriptScopeTest.java
test/javax/script/JavaScriptScopeTest.java
+4
-3
test/javax/script/NullUndefinedVarTest.java
test/javax/script/NullUndefinedVarTest.java
+4
-3
test/javax/script/PluggableContextTest.java
test/javax/script/PluggableContextTest.java
+6
-2
test/javax/script/ProviderTest.java
test/javax/script/ProviderTest.java
+3
-2
test/javax/script/RhinoExceptionTest.java
test/javax/script/RhinoExceptionTest.java
+7
-3
test/javax/script/Test1.java
test/javax/script/Test1.java
+4
-3
test/javax/script/Test2.java
test/javax/script/Test2.java
+5
-1
test/javax/script/Test3.java
test/javax/script/Test3.java
+7
-2
test/javax/script/Test4.java
test/javax/script/Test4.java
+6
-2
test/javax/script/Test5.java
test/javax/script/Test5.java
+6
-2
test/javax/script/Test6.java
test/javax/script/Test6.java
+6
-2
test/javax/script/Test7.java
test/javax/script/Test7.java
+6
-2
test/javax/script/Test8.java
test/javax/script/Test8.java
+6
-2
test/javax/script/VersionTest.java
test/javax/script/VersionTest.java
+4
-3
test/sun/tools/jrunscript/CheckEngine.java
test/sun/tools/jrunscript/CheckEngine.java
+45
-0
test/sun/tools/jrunscript/common.sh
test/sun/tools/jrunscript/common.sh
+1
-0
test/sun/tools/jrunscript/jrunscript-DTest.sh
test/sun/tools/jrunscript/jrunscript-DTest.sh
+7
-1
test/sun/tools/jrunscript/jrunscript-argsTest.sh
test/sun/tools/jrunscript/jrunscript-argsTest.sh
+7
-1
test/sun/tools/jrunscript/jrunscript-cpTest.sh
test/sun/tools/jrunscript/jrunscript-cpTest.sh
+7
-1
test/sun/tools/jrunscript/jrunscript-eTest.sh
test/sun/tools/jrunscript/jrunscript-eTest.sh
+7
-1
test/sun/tools/jrunscript/jrunscript-fTest.sh
test/sun/tools/jrunscript/jrunscript-fTest.sh
+7
-1
test/sun/tools/jrunscript/jrunscriptTest.sh
test/sun/tools/jrunscript/jrunscriptTest.sh
+7
-1
未找到文件。
test/java/lang/management/ThreadMXBean/Locks.java
浏览文件 @
b036a7c2
...
@@ -197,8 +197,12 @@ public class Locks {
...
@@ -197,8 +197,12 @@ public class Locks {
synchronized
(
ready
)
{
synchronized
(
ready
)
{
// wait until WaitingThread about to wait for objC
// wait until WaitingThread about to wait for objC
thrsync
.
waitForSignal
();
thrsync
.
waitForSignal
();
// give chance to enter wait.
goSleep
(
100
);
int
retryCount
=
0
;
while
(
waiter
.
getState
()
!=
Thread
.
State
.
WAITING
&&
retryCount
++
<
500
)
{
goSleep
(
100
);
}
checkBlockedObject
(
waiter
,
objC
,
null
,
Thread
.
State
.
WAITING
);
checkBlockedObject
(
waiter
,
objC
,
null
,
Thread
.
State
.
WAITING
);
synchronized
(
objC
)
{
synchronized
(
objC
)
{
...
...
test/javax/script/E4XErrorTest.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6346734
* @bug 6346734
6705893
* @summary We do *not* support E4X (ECMAScript for XML) in our
* @summary We do *not* support E4X (ECMAScript for XML) in our
* implementation. We want to throw error on XML literals
* implementation. We want to throw error on XML literals
* as early as possible rather than at "runtime" - i.e., when
* as early as possible rather than at "runtime" - i.e., when
...
@@ -37,9 +37,10 @@ public class E4XErrorTest {
...
@@ -37,9 +37,10 @@ public class E4XErrorTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngine
jsengine
=
manager
.
getEngineByName
(
"js"
);
ScriptEngine
jsengine
=
Helper
.
getJsEngine
(
manager
);
if
(
jsengine
==
null
)
{
if
(
jsengine
==
null
)
{
throw
new
RuntimeException
(
"no js engine found"
);
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
}
// The test below depends on the error message content
// The test below depends on the error message content
...
...
test/javax/script/Helper.java
0 → 100644
浏览文件 @
b036a7c2
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import
javax.script.*
;
/**
* Helper class to consolidate testing requirements for a js engine.
* A js engine is required as part of Sun's product JDK.
*/
public
class
Helper
{
private
Helper
()
{};
// Don't instantiate
public
static
ScriptEngine
getJsEngine
(
ScriptEngineManager
m
)
{
ScriptEngine
e
=
m
.
getEngineByName
(
"js"
);
if
(
e
==
null
&&
System
.
getProperty
(
"java.runtime.name"
).
startsWith
(
"Java(TM)"
))
{
// A js engine is requied for Sun's product JDK
throw
new
RuntimeException
(
"no js engine found"
);
}
return
e
;
}
}
test/javax/script/JavaScriptScopeTest.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6346733
* @bug 6346733
6705893
* @summary Verify that independent Bindings instances don't
* @summary Verify that independent Bindings instances don't
* get affected by default scope assignments. Also, verify
* get affected by default scope assignments. Also, verify
* that script globals can be created and accessed from Java
* that script globals can be created and accessed from Java
...
@@ -36,9 +36,10 @@ public class JavaScriptScopeTest {
...
@@ -36,9 +36,10 @@ public class JavaScriptScopeTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngine
jsengine
=
manager
.
getEngineByName
(
"js"
);
ScriptEngine
jsengine
=
Helper
.
getJsEngine
(
manager
);
if
(
jsengine
==
null
)
{
if
(
jsengine
==
null
)
{
throw
new
RuntimeException
(
"no js engine found"
);
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
}
jsengine
.
eval
(
"var v = 'hello';"
);
jsengine
.
eval
(
"var v = 'hello';"
);
// Create a new scope
// Create a new scope
...
...
test/javax/script/NullUndefinedVarTest.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6346732
* @bug 6346732
6705893
* @summary should be able to assign null and undefined
* @summary should be able to assign null and undefined
* value to JavaScript global variables.
* value to JavaScript global variables.
*/
*/
...
@@ -34,9 +34,10 @@ public class NullUndefinedVarTest {
...
@@ -34,9 +34,10 @@ public class NullUndefinedVarTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngine
jsengine
=
manager
.
getEngineByName
(
"js"
);
ScriptEngine
jsengine
=
Helper
.
getJsEngine
(
manager
);
if
(
jsengine
==
null
)
{
if
(
jsengine
==
null
)
{
throw
new
RuntimeException
(
"no js engine found"
);
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
}
jsengine
.
eval
(
"var n = null; "
+
jsengine
.
eval
(
"var n = null; "
+
"if (n !== null) throw 'expecting null';"
+
"if (n !== null) throw 'expecting null';"
+
...
...
test/javax/script/PluggableContextTest.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6398614
* @bug 6398614
6705893
* @summary Create a user defined ScriptContext and check
* @summary Create a user defined ScriptContext and check
* that script can access variables from non-standard scopes
* that script can access variables from non-standard scopes
*/
*/
...
@@ -35,7 +35,11 @@ public class PluggableContextTest {
...
@@ -35,7 +35,11 @@ public class PluggableContextTest {
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptContext
ctx
=
new
MyContext
();
ScriptContext
ctx
=
new
MyContext
();
ctx
.
setAttribute
(
"x"
,
"hello"
,
MyContext
.
APP_SCOPE
);
ctx
.
setAttribute
(
"x"
,
"hello"
,
MyContext
.
APP_SCOPE
);
ScriptEngine
e
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
e
=
Helper
.
getJsEngine
(
m
);
if
(
e
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
// the following reference to 'x' throws exception
// the following reference to 'x' throws exception
// if APP_SCOPE is not searched.
// if APP_SCOPE is not searched.
e
.
eval
(
"x"
,
ctx
);
e
.
eval
(
"x"
,
ctx
);
...
...
test/javax/script/ProviderTest.java
浏览文件 @
b036a7c2
...
@@ -35,9 +35,10 @@ public class ProviderTest {
...
@@ -35,9 +35,10 @@ public class ProviderTest {
if
(
se
==
null
)
{
if
(
se
==
null
)
{
throw
new
RuntimeException
(
"can't locate dummy engine"
);
throw
new
RuntimeException
(
"can't locate dummy engine"
);
}
}
se
=
manager
.
getEngineByName
(
"js"
);
se
=
Helper
.
getJsEngine
(
manager
);
if
(
se
==
null
)
{
if
(
se
==
null
)
{
throw
new
RuntimeException
(
"can't locate JavaScript engine"
);
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
}
}
}
}
}
test/javax/script/RhinoExceptionTest.java
浏览文件 @
b036a7c2
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
/*
/*
* @test
* @test
* @bug 6474943
* @bug 6474943
6705893
* @summary Test that Rhi
on
exception messages are
* @summary Test that Rhi
no
exception messages are
* available from ScriptException.
* available from ScriptException.
*/
*/
...
@@ -36,7 +36,11 @@ public class RhinoExceptionTest {
...
@@ -36,7 +36,11 @@ public class RhinoExceptionTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
engine
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
engine
=
Helper
.
getJsEngine
(
m
);
if
(
engine
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
engine
.
put
(
"msg"
,
ERROR_MSG
);
engine
.
put
(
"msg"
,
ERROR_MSG
);
try
{
try
{
engine
.
eval
(
"throw new Error(msg);"
);
engine
.
eval
(
"throw new Error(msg);"
);
...
...
test/javax/script/Test1.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Create JavaScript engine and execute a simple script.
* @summary Create JavaScript engine and execute a simple script.
* Tests script engine discovery mechanism.
* Tests script engine discovery mechanism.
*/
*/
...
@@ -35,9 +35,10 @@ public class Test1 {
...
@@ -35,9 +35,10 @@ public class Test1 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"\nTest1\n"
);
System
.
out
.
println
(
"\nTest1\n"
);
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngine
jsengine
=
manager
.
getEngineByName
(
"js"
);
ScriptEngine
jsengine
=
Helper
.
getJsEngine
(
manager
);
if
(
jsengine
==
null
)
{
if
(
jsengine
==
null
)
{
throw
new
RuntimeException
(
"no js engine found"
);
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
}
jsengine
.
eval
(
new
FileReader
(
jsengine
.
eval
(
new
FileReader
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test1.js"
)));
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test1.js"
)));
...
...
test/javax/script/Test2.java
浏览文件 @
b036a7c2
...
@@ -50,7 +50,11 @@ public class Test2 {
...
@@ -50,7 +50,11 @@ public class Test2 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"\nTest2\n"
);
System
.
out
.
println
(
"\nTest2\n"
);
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
eng
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
eng
=
Helper
.
getJsEngine
(
m
);
if
(
eng
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
eng
.
put
(
"Testobj"
,
new
Testobj
(
"Hello World"
));
eng
.
put
(
"Testobj"
,
new
Testobj
(
"Hello World"
));
eng
.
eval
(
new
FileReader
(
eng
.
eval
(
new
FileReader
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test2.js"
)));
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test2.js"
)));
...
...
test/javax/script/Test3.java
浏览文件 @
b036a7c2
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
*
*
* 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
* under the terms of the GNU General Public License version 2 only, as
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* published by the Free Software Foundation.
*
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* This code is distributed in the hope that it will be useful, but WITHOUT
...
@@ -23,7 +24,7 @@
...
@@ -23,7 +24,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Test engine and global scopes
* @summary Test engine and global scopes
*/
*/
...
@@ -37,7 +38,11 @@ public class Test3 {
...
@@ -37,7 +38,11 @@ public class Test3 {
final
Reader
reader
=
new
FileReader
(
final
Reader
reader
=
new
FileReader
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test3.js"
));
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test3.js"
));
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
final
ScriptEngine
engine
=
m
.
getEngineByName
(
"js"
);
final
ScriptEngine
engine
=
Helper
.
getJsEngine
(
m
);
if
(
engine
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
Bindings
en
=
new
SimpleBindings
();
Bindings
en
=
new
SimpleBindings
();
engine
.
setBindings
(
en
,
ScriptContext
.
ENGINE_SCOPE
);
engine
.
setBindings
(
en
,
ScriptContext
.
ENGINE_SCOPE
);
en
.
put
(
"key"
,
"engine value"
);
en
.
put
(
"key"
,
"engine value"
);
...
...
test/javax/script/Test4.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Test script functions implementing Java interface
* @summary Test script functions implementing Java interface
*/
*/
...
@@ -34,7 +34,11 @@ public class Test4 {
...
@@ -34,7 +34,11 @@ public class Test4 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"\nTest4\n"
);
System
.
out
.
println
(
"\nTest4\n"
);
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
e
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
e
=
Helper
.
getJsEngine
(
m
);
if
(
e
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
e
.
eval
(
new
FileReader
(
e
.
eval
(
new
FileReader
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test4.js"
)));
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test4.js"
)));
Invocable
inv
=
(
Invocable
)
e
;
Invocable
inv
=
(
Invocable
)
e
;
...
...
test/javax/script/Test5.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Tests engine, global scopes and scope hiding.
* @summary Tests engine, global scopes and scope hiding.
*/
*/
...
@@ -34,7 +34,11 @@ public class Test5 {
...
@@ -34,7 +34,11 @@ public class Test5 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"\nTest5\n"
);
System
.
out
.
println
(
"\nTest5\n"
);
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
engine
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
engine
=
Helper
.
getJsEngine
(
m
);
if
(
engine
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
Bindings
g
=
new
SimpleBindings
();
Bindings
g
=
new
SimpleBindings
();
Bindings
e
=
new
SimpleBindings
();
Bindings
e
=
new
SimpleBindings
();
g
.
put
(
"key"
,
"value in global"
);
g
.
put
(
"key"
,
"value in global"
);
...
...
test/javax/script/Test6.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Test basic script compilation. Value eval'ed from
* @summary Test basic script compilation. Value eval'ed from
* compiled and interpreted scripts should be same.
* compiled and interpreted scripts should be same.
*/
*/
...
@@ -35,7 +35,11 @@ public class Test6 {
...
@@ -35,7 +35,11 @@ public class Test6 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"\nTest6\n"
);
System
.
out
.
println
(
"\nTest6\n"
);
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
engine
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
engine
=
Helper
.
getJsEngine
(
m
);
if
(
engine
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
Reader
reader
=
new
FileReader
(
Reader
reader
=
new
FileReader
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test6.js"
));
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test6.js"
));
engine
.
eval
(
reader
);
engine
.
eval
(
reader
);
...
...
test/javax/script/Test7.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Tests importPackage and java access in script
* @summary Tests importPackage and java access in script
*/
*/
...
@@ -37,7 +37,11 @@ public class Test7 {
...
@@ -37,7 +37,11 @@ public class Test7 {
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test7.js"
);
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test7.js"
);
Reader
r
=
new
FileReader
(
file
);
Reader
r
=
new
FileReader
(
file
);
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
eng
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
eng
=
Helper
.
getJsEngine
(
m
);
if
(
eng
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
eng
.
put
(
"filename"
,
file
.
getAbsolutePath
());
eng
.
put
(
"filename"
,
file
.
getAbsolutePath
());
eng
.
eval
(
r
);
eng
.
eval
(
r
);
String
str
=
(
String
)
eng
.
get
(
"firstLine"
);
String
str
=
(
String
)
eng
.
get
(
"firstLine"
);
...
...
test/javax/script/Test8.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6249843
* @bug 6249843
6705893
* @summary Test invoking script function or method from Java
* @summary Test invoking script function or method from Java
*/
*/
...
@@ -34,7 +34,11 @@ public class Test8 {
...
@@ -34,7 +34,11 @@ public class Test8 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"\nTest8\n"
);
System
.
out
.
println
(
"\nTest8\n"
);
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngineManager
m
=
new
ScriptEngineManager
();
ScriptEngine
e
=
m
.
getEngineByName
(
"js"
);
ScriptEngine
e
=
Helper
.
getJsEngine
(
m
);
if
(
e
==
null
)
{
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
e
.
eval
(
new
FileReader
(
e
.
eval
(
new
FileReader
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test8.js"
)));
new
File
(
System
.
getProperty
(
"test.src"
,
"."
),
"Test8.js"
)));
Invocable
inv
=
(
Invocable
)
e
;
Invocable
inv
=
(
Invocable
)
e
;
...
...
test/javax/script/VersionTest.java
浏览文件 @
b036a7c2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/*
/*
* @test
* @test
* @bug 6346729
* @bug 6346729
6705893
* @summary Create JavaScript engine and check language and engine version
* @summary Create JavaScript engine and check language and engine version
*/
*/
...
@@ -37,9 +37,10 @@ public class VersionTest {
...
@@ -37,9 +37,10 @@ public class VersionTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngine
jsengine
=
manager
.
getEngineByName
(
"js"
);
ScriptEngine
jsengine
=
Helper
.
getJsEngine
(
manager
);
if
(
jsengine
==
null
)
{
if
(
jsengine
==
null
)
{
throw
new
RuntimeException
(
"no js engine found"
);
System
.
out
.
println
(
"Warning: No js engine found; test vacuously passes."
);
return
;
}
}
String
langVersion
=
jsengine
.
getFactory
().
getLanguageVersion
();
String
langVersion
=
jsengine
.
getFactory
().
getLanguageVersion
();
if
(!
langVersion
.
equals
(
JS_LANG_VERSION
))
{
if
(!
langVersion
.
equals
(
JS_LANG_VERSION
))
{
...
...
test/sun/tools/jrunscript/CheckEngine.java
0 → 100644
浏览文件 @
b036a7c2
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import
javax.script.*
;
/*
* If the JDK being tested is <b>not</b> a Sun product JDK and a js
* engine is not present, return an exit code of 2 to indicate that
* the jrunscript tests which assume a js engine can be vacuously
* passed.
*/
public
class
CheckEngine
{
public
static
void
main
(
String
...
args
)
{
int
exitCode
=
0
;
ScriptEngine
engine
=
(
new
ScriptEngineManager
()).
getEngineByName
(
"js"
);
if
(
engine
==
null
&&
!(
System
.
getProperty
(
"java.runtime.name"
).
startsWith
(
"Java(TM)"
)))
{
exitCode
=
2
;
}
System
.
exit
(
exitCode
);
}
}
test/sun/tools/jrunscript/common.sh
浏览文件 @
b036a7c2
...
@@ -52,4 +52,5 @@ setup() {
...
@@ -52,4 +52,5 @@ setup() {
JRUNSCRIPT
=
"
${
TESTJAVA
}
/bin/jrunscript"
JRUNSCRIPT
=
"
${
TESTJAVA
}
/bin/jrunscript"
JAVAC
=
"
${
TESTJAVA
}
/bin/javac"
JAVAC
=
"
${
TESTJAVA
}
/bin/javac"
JAVA
=
"
${
TESTJAVA
}
/bin/java"
}
}
test/sun/tools/jrunscript/jrunscript-DTest.sh
浏览文件 @
b036a7c2
...
@@ -25,13 +25,19 @@
...
@@ -25,13 +25,19 @@
# @test
# @test
# @bug 6265810
# @bug 6265810 6705893
# @build CheckEngine
# @run shell jrunscript-DTest.sh
# @run shell jrunscript-DTest.sh
# @summary Test that output of 'jrunscript -D'
# @summary Test that output of 'jrunscript -D'
.
${
TESTSRC
-.
}
/common.sh
.
${
TESTSRC
-.
}
/common.sh
setup
setup
${
JAVA
}
-cp
${
TESTCLASSES
}
CheckEngine
if
[
$?
-eq
2
]
;
then
echo
"No js engine found and engine not required; test vacuously passes."
exit
0
fi
# test whether value specifieD by -D option is passed
# test whether value specifieD by -D option is passed
# to script as java.lang.System property. sysProps is
# to script as java.lang.System property. sysProps is
...
...
test/sun/tools/jrunscript/jrunscript-argsTest.sh
浏览文件 @
b036a7c2
...
@@ -25,13 +25,19 @@
...
@@ -25,13 +25,19 @@
# @test
# @test
# @bug 6265810
# @bug 6265810 6705893
# @build CheckEngine
# @run shell jrunscript-argsTest.sh
# @run shell jrunscript-argsTest.sh
# @summary Test passing of script arguments from command line
# @summary Test passing of script arguments from command line
.
${
TESTSRC
-.
}
/common.sh
.
${
TESTSRC
-.
}
/common.sh
setup
setup
${
JAVA
}
-cp
${
TESTCLASSES
}
CheckEngine
if
[
$?
-eq
2
]
;
then
echo
"No js engine found and engine not required; test vacuously passes."
exit
0
fi
# we check whether "excess" args are passed as script arguments
# we check whether "excess" args are passed as script arguments
...
...
test/sun/tools/jrunscript/jrunscript-cpTest.sh
浏览文件 @
b036a7c2
...
@@ -25,13 +25,19 @@
...
@@ -25,13 +25,19 @@
# @test
# @test
# @bug 6265810
# @bug 6265810 6705893
# @build CheckEngine
# @run shell jrunscript-cpTest.sh
# @run shell jrunscript-cpTest.sh
# @summary Test -cp option to set classpath
# @summary Test -cp option to set classpath
.
${
TESTSRC
-.
}
/common.sh
.
${
TESTSRC
-.
}
/common.sh
setup
setup
${
JAVA
}
-cp
${
TESTCLASSES
}
CheckEngine
if
[
$?
-eq
2
]
;
then
echo
"No js engine found and engine not required; test vacuously passes."
exit
0
fi
rm
-f
Hello.class
rm
-f
Hello.class
${
JAVAC
}
${
TESTSRC
}
/Hello.java
-d
.
${
JAVAC
}
${
TESTSRC
}
/Hello.java
-d
.
...
...
test/sun/tools/jrunscript/jrunscript-eTest.sh
浏览文件 @
b036a7c2
...
@@ -25,13 +25,19 @@
...
@@ -25,13 +25,19 @@
# @test
# @test
# @bug 6265810
# @bug 6265810 6705893
# @build CheckEngine
# @run shell jrunscript-eTest.sh
# @run shell jrunscript-eTest.sh
# @summary Test that output of 'jrunscript -e' matches the dash-e.out file
# @summary Test that output of 'jrunscript -e' matches the dash-e.out file
.
${
TESTSRC
-.
}
/common.sh
.
${
TESTSRC
-.
}
/common.sh
setup
setup
${
JAVA
}
-cp
${
TESTCLASSES
}
CheckEngine
if
[
$?
-eq
2
]
;
then
echo
"No js engine found and engine not required; test vacuously passes."
exit
0
fi
rm
-f
jrunscript-eTest.out 2>/dev/null
rm
-f
jrunscript-eTest.out 2>/dev/null
${
JRUNSCRIPT
}
-e
"println('hello')"
>
jrunscript-eTest.out 2>&1
${
JRUNSCRIPT
}
-e
"println('hello')"
>
jrunscript-eTest.out 2>&1
...
...
test/sun/tools/jrunscript/jrunscript-fTest.sh
浏览文件 @
b036a7c2
...
@@ -25,13 +25,19 @@
...
@@ -25,13 +25,19 @@
# @test
# @test
# @bug 6265810
# @bug 6265810 6705893
# @build CheckEngine
# @run shell jrunscript-fTest.sh
# @run shell jrunscript-fTest.sh
# @summary Test that output of 'jrunscript -f' matches the dash-f.out file
# @summary Test that output of 'jrunscript -f' matches the dash-f.out file
.
${
TESTSRC
-.
}
/common.sh
.
${
TESTSRC
-.
}
/common.sh
setup
setup
${
JAVA
}
-cp
${
TESTCLASSES
}
CheckEngine
if
[
$?
-eq
2
]
;
then
echo
"No js engine found and engine not required; test vacuously passes."
exit
0
fi
rm
-f
jrunscript-fTest.out 2>/dev/null
rm
-f
jrunscript-fTest.out 2>/dev/null
${
JRUNSCRIPT
}
-f
${
TESTSRC
}
/hello.js
>
jrunscript-fTest.out 2>&1
${
JRUNSCRIPT
}
-f
${
TESTSRC
}
/hello.js
>
jrunscript-fTest.out 2>&1
...
...
test/sun/tools/jrunscript/jrunscriptTest.sh
浏览文件 @
b036a7c2
...
@@ -25,13 +25,19 @@
...
@@ -25,13 +25,19 @@
# @test
# @test
# @bug 6265810
# @bug 6265810 6705893
# @build CheckEngine
# @run shell jrunscriptTest.sh
# @run shell jrunscriptTest.sh
# @summary Test that output of 'jrunscript' interactive matches the repl.out file
# @summary Test that output of 'jrunscript' interactive matches the repl.out file
.
${
TESTSRC
-.
}
/common.sh
.
${
TESTSRC
-.
}
/common.sh
setup
setup
${
JAVA
}
-cp
${
TESTCLASSES
}
CheckEngine
if
[
$?
-eq
2
]
;
then
echo
"No js engine found and engine not required; test vacuously passes."
exit
0
fi
rm
-f
jrunscriptTest.out 2>/dev/null
rm
-f
jrunscriptTest.out 2>/dev/null
${
JRUNSCRIPT
}
>
jrunscriptTest.out 2>&1
<<
EOF
${
JRUNSCRIPT
}
>
jrunscriptTest.out 2>&1
<<
EOF
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录