public class LoggingListener
extends org.junit.runner.notification.RunListener
RunListener that allows changing the log level for a specific test method. When a test method is annotated with the
TestLogging annotation, the level for the specified loggers will be internally saved before the test method execution and
overridden with the specified ones. At the end of the test method execution the original loggers levels will be restored.
This class is not thread-safe. Given the static nature of the logging API, it assumes that tests are never run concurrently in the same
JVM. For the very same reason no synchronization has been implemented regarding the save/restore process of the original loggers
levels.| Constructor | Description |
|---|---|
LoggingListener() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
testFinished(org.junit.runner.Description description) |
|
void |
testRunFinished(org.junit.runner.Result result) |
|
void |
testRunStarted(org.junit.runner.Description description) |
|
void |
testStarted(org.junit.runner.Description description) |
public void testRunStarted(org.junit.runner.Description description)
throws java.lang.Exception
testRunStarted in class org.junit.runner.notification.RunListenerjava.lang.Exceptionpublic void testRunFinished(org.junit.runner.Result result)
throws java.lang.Exception
testRunFinished in class org.junit.runner.notification.RunListenerjava.lang.Exceptionpublic void testStarted(org.junit.runner.Description description)
throws java.lang.Exception
testStarted in class org.junit.runner.notification.RunListenerjava.lang.Exceptionpublic void testFinished(org.junit.runner.Description description)
throws java.lang.Exception
testFinished in class org.junit.runner.notification.RunListenerjava.lang.Exception