public interface ILogChecker
Interface for monitoring logging events.
Designed to have an implementation chosen by the LogChecker annotation in a class
extending from BaseTest.
| Modifier and Type | Method and Description |
|---|---|
void |
addLogEvent(ch.qos.logback.classic.spi.ILoggingEvent event)
Provides the checker with a logging event.
|
void |
finalCheck()
Run any assertions (designed to be based on logging events received since the last call to
init(Description)), potentially throwing an assertion failure to fail the test
if appropriate. |
void |
init(org.junit.runner.Description description)
Called before each JUnit
Test method. |
void init(org.junit.runner.Description description)
Called before each JUnit Test method.
This can be used to configure the instance, possibly optimizing it to only capture certain
levels or categories of logging events, etc.
Additional per-method configurations can be read from additional annotations as necessary.
void addLogEvent(ch.qos.logback.classic.spi.ILoggingEvent event)
Provides the checker with a logging event. It is recommended to only keep track of anything to be reported. Immediately throwing as assertion failure is possible, but not recommended - as this method may not always be called from the main thread, causing a worker thread to terminate prematurely.
void finalCheck()
throws Exception
Run any assertions (designed to be based on logging events received since the last call to
init(Description)), potentially throwing an assertion failure to fail the test
if appropriate.
ExceptionCopyright © 2017 Mark A. Ziesemer. All rights reserved.