kotest-extensions / io.kotest.extensions.system / NoExitSecurityManager

NoExitSecurityManager

class NoExitSecurityManager : SecurityManager

An implementation of SecurityManager that throws a SystemExitException exception whenever System.exit(int) is invoked.

Implemenation inspired from https://github.com/stefanbirkner/system-rules/blob/72250d0451f9f1a5c5852502b5e9b0c874aeab42/src/main/java/org/junit/contrib/java/lang/system/internal/NoExitSecurityManager.java Apache Licensed.

Constructors

<init>

An implementation of SecurityManager that throws a SystemExitException exception whenever System.exit(int) is invoked.

NoExitSecurityManager(originalSecurityManager: SecurityManager?)

Functions

checkAccept

fun checkAccept(host: String, port: Int): Unit

checkAccess

fun checkAccess(t: Thread): Unit
fun checkAccess(g: ThreadGroup): Unit

checkConnect

fun checkConnect(host: String, port: Int): Unit
fun checkConnect(host: String, port: Int, context: Any): Unit

checkCreateClassLoader

fun checkCreateClassLoader(): Unit

checkDelete

fun checkDelete(file: String): Unit

checkExec

fun checkExec(cmd: String): Unit

checkExit

fun checkExit(status: Int): Nothing

checkLink

fun checkLink(lib: String): Unit

checkListen

fun checkListen(port: Int): Unit

checkMulticast

fun checkMulticast(maddr: InetAddress): Unit
fun checkMulticast(maddr: InetAddress, ttl: Byte): Unit

checkPackageAccess

fun checkPackageAccess(pkg: String): Unit

checkPackageDefinition

fun checkPackageDefinition(pkg: String): Unit

checkPermission

fun checkPermission(perm: Permission): Unit
fun checkPermission(perm: Permission, context: Any): Unit

checkPrintJobAccess

fun checkPrintJobAccess(): Unit

checkPropertiesAccess

fun checkPropertiesAccess(): Unit

checkPropertyAccess

fun checkPropertyAccess(key: String): Unit

checkRead

fun checkRead(fd: FileDescriptor): Unit
fun checkRead(file: String): Unit
fun checkRead(file: String, context: Any): Unit

checkSecurityAccess

fun checkSecurityAccess(target: String): Unit

checkSetFactory

fun checkSetFactory(): Unit

checkWrite

fun checkWrite(fd: FileDescriptor): Unit
fun checkWrite(file: String): Unit

getSecurityContext

fun getSecurityContext(): Any

getThreadGroup

fun getThreadGroup(): ThreadGroup