Review request 8152508: tools/jlink/SecurityTest.java failed intermittently
Mandy Chung
mandy.chung at oracle.com
Thu Mar 24 19:10:26 UTC 2016
This test deserves some cleanup and I suspect the intermittent failure may be related to running in agent mode.
Mandy
diff --git a/test/tools/jlink/SecurityTest.java b/test/tools/jlink/SecurityTest.java
--- a/test/tools/jlink/SecurityTest.java
+++ b/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 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");
}
-
}
-}
More information about the jigsaw-dev
mailing list