changeset 13959:3abd25870915

8152508: tools/jlink/SecurityTest.java failed intermittently Reviewed-by: alanb
author mchung
date Thu, 24 Mar 2016 13:09:48 -0700
parents 4e79181befb9
children aac56691c2c4 732099b9085b
files test/tools/jlink/SecurityTest.java
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/jlink/SecurityTest.java	Thu Mar 24 11:20:14 2016 -0700
+++ b/test/tools/jlink/SecurityTest.java	Thu Mar 24 13:09:48 2016 -0700
@@ -25,7 +25,7 @@
  * @test
  * @summary Test JlinkPermission
  * @author Jean-Francois Denise
- * @run main SecurityTest
+ * @run main/othervm SecurityTest
  */
 
 import java.security.AccessControlException;
@@ -36,16 +36,11 @@
     public static void main(String[] args) throws Exception {
         new Jlink();
         System.setSecurityManager(new SecurityManager());
-        boolean failed = false;
         try {
             new Jlink();
-            failed = true;
+            throw new Exception("Call should have failed");
         } catch (AccessControlException ex) {
-            //XXX OK.
+            // expected exception
         }
-        if (failed) {
-            throw new Exception("Call should have failed");
-        }
-
     }
 }