8152508: tools/jlink/SecurityTest.java failed intermittently

Reviewed-by: alanb
This commit is contained in:
Mandy Chung 2016-03-24 13:09:48 -07:00
parent 366e4b930f
commit 81efd32432

View File

@ -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
}
}
}