public class SecurityManagerTestListener
extends SecurityManagerListener
Overrides System Security Manager with specified securityManager
This is a Listener for code that uses the System Security Manager. It replaces the System Security Manager with the desired securityManager.
After the execution of the test, the System Security Manager is set to what it was before. This will also happen if the original manager is null.
Attention: This code is subject to race conditions. As Java's System Manager is only one per JVM, this code will replace it. However, all other tests are going to use it if tests are running in parallel.
| Constructor and Description |
|---|
SecurityManagerTestListener(java.lang.SecurityManager securityManager)
Overrides System Security Manager with specified securityManager
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterTest(io.kotlintest.TestCase testCase,
io.kotlintest.TestResult result) |
void |
beforeTest(io.kotlintest.TestCase testCase) |
changeSecurityManager, getSecurityManager, resetSecurityManagerpublic SecurityManagerTestListener(java.lang.SecurityManager securityManager)
Overrides System Security Manager with specified securityManager
This is a Listener for code that uses the System Security Manager. It replaces the System Security Manager with the desired securityManager.
After the execution of the test, the System Security Manager is set to what it was before. This will also happen if the original manager is null.
Attention: This code is subject to race conditions. As Java's System Manager is only one per JVM, this code will replace it. However, all other tests are going to use it if tests are running in parallel.