# HG changeset patch # User jlaskey # Date 1360169469 14400 # Node ID f5502e7b3b718bdd84552a29665ed330e952fd0c # Parent ccf1c34f26d95a63c3239dd44836f518d7ac5d75 8007643: Add testing for quit and exit Reviewed-by: sundar Contributed-by: james.laskey@oracle.com diff -r ccf1c34f26d9 -r f5502e7b3b71 nashorn/test/script/sandbox/exit.js --- a/nashorn/test/script/sandbox/exit.js Wed Feb 06 11:57:51 2013 -0400 +++ b/nashorn/test/script/sandbox/exit.js Wed Feb 06 12:51:09 2013 -0400 @@ -22,7 +22,7 @@ */ /** - * Try to call System.exit. + * Try to call System.exit, quit and exit. * * @test * @security @@ -43,4 +43,18 @@ check(e); } +try { + quit(); + // will not reach here regardless of outcome.. +} catch (e) { + check(e); +} + +try { + exit(0); + // will not reach here regardless of outcome.. +} catch (e) { + check(e); +} + print("Success, didn't exit!"); diff -r ccf1c34f26d9 -r f5502e7b3b71 nashorn/test/script/sandbox/exit.js.EXPECTED --- a/nashorn/test/script/sandbox/exit.js.EXPECTED Wed Feb 06 11:57:51 2013 -0400 +++ b/nashorn/test/script/sandbox/exit.js.EXPECTED Wed Feb 06 12:51:09 2013 -0400 @@ -1,2 +1,4 @@ +java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "exitVM.0") +java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "exitVM.0") java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "exitVM.0") Success, didn't exit!