8152508: tools/jlink/SecurityTest.java failed intermittently
Reviewed-by: alanb
This commit is contained in:
parent
366e4b930f
commit
81efd32432
@ -25,7 +25,7 @@
|
|||||||
* @test
|
* @test
|
||||||
* @summary Test JlinkPermission
|
* @summary Test JlinkPermission
|
||||||
* @author Jean-Francois Denise
|
* @author Jean-Francois Denise
|
||||||
* @run main SecurityTest
|
* @run main/othervm SecurityTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.security.AccessControlException;
|
import java.security.AccessControlException;
|
||||||
@ -36,16 +36,11 @@ public class SecurityTest {
|
|||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
new Jlink();
|
new Jlink();
|
||||||
System.setSecurityManager(new SecurityManager());
|
System.setSecurityManager(new SecurityManager());
|
||||||
boolean failed = false;
|
|
||||||
try {
|
try {
|
||||||
new Jlink();
|
new Jlink();
|
||||||
failed = true;
|
|
||||||
} catch (AccessControlException ex) {
|
|
||||||
//XXX OK.
|
|
||||||
}
|
|
||||||
if (failed) {
|
|
||||||
throw new Exception("Call should have failed");
|
throw new Exception("Call should have failed");
|
||||||
|
} catch (AccessControlException ex) {
|
||||||
|
// expected exception
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user