name.didier.david.test4j.utils.NoExitSecurityManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ndd-test4j Show documentation
Show all versions of ndd-test4j Show documentation
Test4J provides testing support.
The newest version!
package name.didier.david.test4j.utils;
import java.security.Permission;
/**
* Forbid to exit the application.
*
* @author ddidier
*/
public class NoExitSecurityManager
extends SecurityManager {
/** Default constructor. */
public NoExitSecurityManager() {
super();
}
/**
* Allow anything.
*
* @param perm the requested permission.
*/
@Override
public void checkPermission(final Permission perm) {
// allow anything.
}
/**
* Allow anything.
*
* @param perm the requested permission.
* @param context a system-dependent security context.
*/
@Override
public void checkPermission(final Permission perm, final Object context) {
// allow anything.
}
/**
* Throws a NoExitException
.
*
* @param status the exit status.
*/
@Override
public void checkExit(final int status) {
super.checkExit(status);
throw new NoExitException("Intercepted exit with status " + status, status);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy