|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.codereligion.cherry.junit.logback.LogRecorder
public class LogRecorder
JUnit rule which records all events emitted by the loggers specified in the given LogSpec at the specified log
level.
| Method Summary | |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
|
ch.qos.logback.classic.spi.ILoggingEvent |
event()
Returns the first event recorded during the test execution, or throws an AssertionError, in case no event was recorded. |
List<ch.qos.logback.classic.spi.ILoggingEvent> |
events()
Returns all events recorded during the test execution in the order they were logged. |
static LogRecorder |
expectedLogs(LogSpec... logSpecs)
Creates a log recorder rule which records events for all logs specified by the given LogSpec. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static LogRecorder expectedLogs(LogSpec... logSpecs)
LogSpec. If the same
logger is specified multiple times with a different log level, then the last spec wins.
logSpecs - the to be expected logs
LogRecorder
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRulepublic List<ch.qos.logback.classic.spi.ILoggingEvent> events()
public ch.qos.logback.classic.spi.ILoggingEvent event()
AssertionError, in case no event was recorded.
AssertionError - when no event was recorded
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||