39 * -XX:+EnableJVMCI
40 * compiler.jvmci.SecurityRestrictionsTest
41 * NO_PERM
42 * @run main/othervm -XX:+UnlockExperimentalVMOptions
43 * -XX:+EnableJVMCI
44 * compiler.jvmci.SecurityRestrictionsTest
45 * ALL_PERM
46 * @run main/othervm -XX:+UnlockExperimentalVMOptions
47 * -XX:+EnableJVMCI
48 * compiler.jvmci.SecurityRestrictionsTest
49 * NO_JVMCI_ACCESS_PERM
50 * @run main/othervm -XX:+UnlockExperimentalVMOptions
51 * -XX:-EnableJVMCI
52 * compiler.jvmci.SecurityRestrictionsTest
53 * NO_JVMCI
54 */
55
56 package compiler.jvmci;
57
58 import jdk.test.lib.Utils;
59 import java.lang.InternalError;
60 import java.lang.reflect.Constructor;
61 import java.security.AccessControlException;
62 import java.security.Permission;
63 import java.util.PropertyPermission;
64 import java.util.function.Consumer;
65 import java.util.logging.Level;
66 import java.util.logging.Logger;
67
68 public class SecurityRestrictionsTest {
69
70 public static void main(String[] args) {
71 try {
72 // to init Utils before call SecurityManager
73 Class.forName(Utils.class.getName(), true,
74 Utils.class.getClassLoader());
75 } catch (ClassNotFoundException e) {
76 throw new Error("[TEST BUG]: jdk.test.lib.Utils not found", e);
77 }
78 try {
79 TestCase mode = TestCase.valueOf(args[0]);
80 mode.run();
81 } catch (IllegalArgumentException e) {
82 throw new Error("[TEST BUG]: Unknown mode " + args[0], e);
83 }
84 }
85
86 private enum TestCase {
|
39 * -XX:+EnableJVMCI
40 * compiler.jvmci.SecurityRestrictionsTest
41 * NO_PERM
42 * @run main/othervm -XX:+UnlockExperimentalVMOptions
43 * -XX:+EnableJVMCI
44 * compiler.jvmci.SecurityRestrictionsTest
45 * ALL_PERM
46 * @run main/othervm -XX:+UnlockExperimentalVMOptions
47 * -XX:+EnableJVMCI
48 * compiler.jvmci.SecurityRestrictionsTest
49 * NO_JVMCI_ACCESS_PERM
50 * @run main/othervm -XX:+UnlockExperimentalVMOptions
51 * -XX:-EnableJVMCI
52 * compiler.jvmci.SecurityRestrictionsTest
53 * NO_JVMCI
54 */
55
56 package compiler.jvmci;
57
58 import jdk.test.lib.Utils;
59
60 import java.security.AccessControlException;
61 import java.security.Permission;
62 import java.util.PropertyPermission;
63 import java.util.function.Consumer;
64
65 public class SecurityRestrictionsTest {
66
67 public static void main(String[] args) {
68 try {
69 // to init Utils before call SecurityManager
70 Class.forName(Utils.class.getName(), true,
71 Utils.class.getClassLoader());
72 } catch (ClassNotFoundException e) {
73 throw new Error("[TEST BUG]: jdk.test.lib.Utils not found", e);
74 }
75 try {
76 TestCase mode = TestCase.valueOf(args[0]);
77 mode.run();
78 } catch (IllegalArgumentException e) {
79 throw new Error("[TEST BUG]: Unknown mode " + args[0], e);
80 }
81 }
82
83 private enum TestCase {
|