# HG changeset patch # User sundar # Date 1361977452 -19800 # Node ID 105e9859a5483a44d1cac8b907237ffe3671037b # Parent 85372a48f9aa47943e18846156b4fe7d3aa1684a 8009140: jtreg tests under sun/tools/jrunscript should use nashorn engine Reviewed-by: alanb diff -r 85372a48f9aa -r 105e9859a548 jdk/test/sun/tools/jrunscript/CheckEngine.java --- a/jdk/test/sun/tools/jrunscript/CheckEngine.java Wed Feb 27 14:24:45 2013 +0000 +++ b/jdk/test/sun/tools/jrunscript/CheckEngine.java Wed Feb 27 20:34:12 2013 +0530 @@ -33,7 +33,7 @@ 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)"))) { diff -r 85372a48f9aa -r 105e9859a548 jdk/test/sun/tools/jrunscript/jrunscript-DTest.sh --- a/jdk/test/sun/tools/jrunscript/jrunscript-DTest.sh Wed Feb 27 14:24:45 2013 +0000 +++ b/jdk/test/sun/tools/jrunscript/jrunscript-DTest.sh Wed Feb 27 20:34:12 2013 +0530 @@ -43,7 +43,7 @@ # to script as java.lang.System property. sysProps is # jrunscript shell built-in variable for System properties. -${JRUNSCRIPT} -Djrunscript.foo=bar </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 ] diff -r 85372a48f9aa -r 105e9859a548 jdk/test/sun/tools/jrunscript/jrunscript-fTest.sh --- a/jdk/test/sun/tools/jrunscript/jrunscript-fTest.sh Wed Feb 27 14:24:45 2013 +0000 +++ b/jdk/test/sun/tools/jrunscript/jrunscript-fTest.sh Wed Feb 27 20:34:12 2013 +0530 @@ -39,22 +39,11 @@ 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 ] diff -r 85372a48f9aa -r 105e9859a548 jdk/test/sun/tools/jrunscript/jrunscriptTest.sh --- a/jdk/test/sun/tools/jrunscript/jrunscriptTest.sh Wed Feb 27 14:24:45 2013 +0000 +++ b/jdk/test/sun/tools/jrunscript/jrunscriptTest.sh Wed Feb 27 20:34:12 2013 +0530 @@ -40,7 +40,7 @@ fi rm -f jrunscriptTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true > jrunscriptTest.out 2>&1 < jrunscriptTest.out 2>&1 </dev/null - exit 1 -fi - -rm -f jrunscriptTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l js > jrunscriptTest.out 2>&1 </dev/null exit 1 fi diff -r 85372a48f9aa -r 105e9859a548 jdk/test/sun/tools/jrunscript/repl.out --- a/jdk/test/sun/tools/jrunscript/repl.out Wed Feb 27 14:24:45 2013 +0000 +++ b/jdk/test/sun/tools/jrunscript/repl.out Wed Feb 27 20:34:12 2013 +0530 @@ -1,7 +1,7 @@ -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