Search in sources :

Example 1 with GoogleTestSecurityManager

use of com.google.testing.junit.runner.util.GoogleTestSecurityManager in project bazel by bazelbuild.

the class JUnit4Runner method installSecurityManager.

private void installSecurityManager() {
    previousSecurityManager = System.getSecurityManager();
    GoogleTestSecurityManager newSecurityManager = new GoogleTestSecurityManager();
    System.setSecurityManager(newSecurityManager);
    // set field after call to setSecurityManager() in case that call fails
    googleTestSecurityManager = newSecurityManager;
}
Also used : GoogleTestSecurityManager(com.google.testing.junit.runner.util.GoogleTestSecurityManager)

Example 2 with GoogleTestSecurityManager

use of com.google.testing.junit.runner.util.GoogleTestSecurityManager in project bazel by bazelbuild.

the class TestRunner method setGoogleTestSecurityManager.

// Sets a new GoogleTestSecurityManager as security manager and returns the previous one.
private static SecurityManager setGoogleTestSecurityManager() {
    SecurityManager previousSecurityManager = System.getSecurityManager();
    GoogleTestSecurityManager newSecurityManager = new GoogleTestSecurityManager();
    System.setSecurityManager(newSecurityManager);
    return previousSecurityManager;
}
Also used : GoogleTestSecurityManager(com.google.testing.junit.runner.util.GoogleTestSecurityManager) GoogleTestSecurityManager(com.google.testing.junit.runner.util.GoogleTestSecurityManager)

Aggregations

GoogleTestSecurityManager (com.google.testing.junit.runner.util.GoogleTestSecurityManager)2