From 81efd32432175c60d55c404d8b29a3184e11c40f Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Thu, 24 Mar 2016 13:09:48 -0700 Subject: [PATCH] 8152508: tools/jlink/SecurityTest.java failed intermittently Reviewed-by: alanb --- jdk/test/tools/jlink/SecurityTest.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/jdk/test/tools/jlink/SecurityTest.java b/jdk/test/tools/jlink/SecurityTest.java index b21c1bc7d09..9497d6f3f34 100644 --- a/jdk/test/tools/jlink/SecurityTest.java +++ b/jdk/test/tools/jlink/SecurityTest.java @@ -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 class SecurityTest { public static void main(String[] args) throws Exception { new Jlink(); System.setSecurityManager(new SecurityManager()); - boolean failed = false; try { new Jlink(); - failed = true; - } catch (AccessControlException ex) { - //XXX OK. - } - if (failed) { throw new Exception("Call should have failed"); + } catch (AccessControlException ex) { + // expected exception } - } }