changeset 75:02f810c26ff9

8007643: Add testing for quit and exit Reviewed-by: sundar Contributed-by: james.laskey@oracle.com
author jlaskey
date Wed, 06 Feb 2013 12:51:09 -0400
parents 2ca25bf25d0c
children d7e83be6e7aa
files test/script/sandbox/exit.js test/script/sandbox/exit.js.EXPECTED
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/script/sandbox/exit.js	Wed Feb 06 11:57:51 2013 -0400
+++ b/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!");
--- a/test/script/sandbox/exit.js.EXPECTED	Wed Feb 06 11:57:51 2013 -0400
+++ b/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!