public final class TestSecurityManager extends SecurityManager
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.util.TestSecurityManager.
inCheck| Constructor and Description |
|---|
TestSecurityManager()
Creates a new TestSecurityManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkExit(int status) |
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, checkWrite, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoaderpublic TestSecurityManager()
-Djava.security.manager=org.apache.lucene.util.TestSecurityManager
is passed to JVM.public void checkExit(int status)
This method inspects the stack trace and checks who is calling
System.exit(int) and similar methods
checkExit in class SecurityManagerSecurityException - if the caller of this method is not the test runner itself.Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.