
//// permission for the junit4 jar
grant codeBase "${junit4.jar.url}" {
  // needed because JUnit requests/ runners don't use access controller contexts
  // and the access control domain propagates up the stack.
  permission java.lang.RuntimePermission "accessDeclaredMembers";
  // needed for io stream handling
  permission java.lang.RuntimePermission "setIO";
  // needed for accessing log files, etc.
  permission java.io.FilePermission "${junit4.tempDir}${/}*", "read,write,delete,execute";
};

//// 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";
  permission java.io.FilePermission "${junit4.childvm.cwd}${/}*", "read,write,delete";
};
