8152508: tools/jlink/SecurityTest.java failed intermittently
authormchung
Thu, 24 Mar 2016 13:09:48 -0700
changeset 36677 a7dca903cb27
parent 36676 ec223ded61e2
child 36678 4a684dceb848
child 36932 920f25b0e30e
8152508: tools/jlink/SecurityTest.java failed intermittently Reviewed-by: alanb
jdk/test/tools/jlink/SecurityTest.java
--- a/jdk/test/tools/jlink/SecurityTest.java	Thu Mar 24 11:20:14 2016 -0700
+++ b/jdk/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");
-        }
-
     }
 }