Package org.apache.lucene.tests.util
Class TestSecurityManager
java.lang.Object
java.lang.SecurityManager
org.apache.lucene.tests.util.TestSecurityManager
A
SecurityManager
that prevents tests calling System.exit(int)
. Only the test
runner itself is allowed to exit the JVM. All other security checks are handled by the default
security policy.
Use this with
-Djava.security.manager=org.apache.lucene.tests.util.TestSecurityManager
.
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkWrite, checkWrite, getClassContext, getSecurityContext, getThreadGroup
-
Constructor Details
-
TestSecurityManager
public TestSecurityManager()Creates a new TestSecurityManager. This ctor is called on JVM startup, when-Djava.security.manager=org.apache.lucene.tests.util.TestSecurityManager
is passed to JVM.
-
-
Method Details
-
checkExit
public void checkExit(int status) This method inspects the stack trace and checks who is calling
System.exit(int)
and similar methods- Overrides:
checkExit
in classSecurityManager
- Throws:
SecurityException
- if the caller of this method is not the test runner itself.
-