1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
// policy file for tests
//// These permissions apply to the JDK itself
//// (actually only needed for "extensions")
grant codeBase "file:${{java.ext.dirs}}/*" {
permission java.security.AllPermission;
};
//// permission for the junit4 jar
grant codeBase "${junit4.jar.url}" {
// needed for io stream handling
permission java.lang.RuntimePermission "setIO";
// workaround for junit access control context bug in processing
// class test request.
permission java.lang.RuntimePermission "accessDeclaredMembers";
};
//// permissions for the randomized runner jar
grant codeBase "${randomizedtesting.jar.url}" {
// optionally needed for access to private test methods (e.g. beforeClass)
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
// needed to handle uncaught exceptions from other threads
permission java.lang.RuntimePermission "setDefaultUncaughtExceptionHandler";
// needed for getTopThreads
permission java.lang.RuntimePermission "modifyThreadGroup";
// needed for TestClass creation
permission java.lang.RuntimePermission "accessDeclaredMembers";
// needed for ThreadLeakControl
permission java.lang.RuntimePermission "getStackTrace";
};
//// permissions for the junit jar
grant codeBase "${junit.jar.url}" {
// needed for TestClass creation
permission java.lang.RuntimePermission "accessDeclaredMembers";
};
//// Test class permission: we want this to be minimal!
grant {
permission java.util.PropertyPermission "*", "read";
//// Java7 and up.
//// permission java.io.FilePermission "<<ALL FILES>>", "read,readlink,write,delete,execute";
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete,execute";
};
|