org.junit.jupiter.api.extension.AfterEachCallback
, org.junit.jupiter.api.extension.BeforeEachCallback
, org.junit.jupiter.api.extension.Extension
, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
public class SystemExitExtension extends Object implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
Constructor | Description |
---|---|
SystemExitExtension() |
Modifier and Type | Method | Description |
---|---|---|
void |
afterEach(org.junit.jupiter.api.extension.ExtensionContext context) |
|
void |
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) |
|
void |
handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context,
Throwable throwable) |
This is here so we can catch exceptions thrown by our own security manager and prevent them from
stopping the annotated test.
|
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
afterEach
in interface org.junit.jupiter.api.extension.AfterEachCallback
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
beforeEach
in interface org.junit.jupiter.api.extension.BeforeEachCallback
public void handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable) throws Throwable
handleTestExecutionException
in interface org.junit.jupiter.api.extension.TestExecutionExceptionHandler
context
- the current extension context; never null
throwable
- the Throwable
to handle; never null
Throwable
- if the throwable argument is not a SystemExitPreventedException