public class AllLogRule extends Object implements org.junit.rules.TestRule
Example usage:
@Rule public AllLogRule logRule = new AllLogRule();
Modifier and Type | Class and Description |
---|---|
class |
AllLogRule.LogStatement
The actual code that executes our capturing logic before the test runs and removes it after it has run.
|
Constructor and Description |
---|
AllLogRule()
Capture INFO log.
|
AllLogRule(LogLevel level)
Caputure passed log level.
|
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement statement,
org.junit.runner.Description description) |
ch.qos.logback.classic.spi.ILoggingEvent |
getLogEvent(int position) |
org.slf4j.Marker |
getMarker(int position) |
String |
getMessage(int position) |
void |
ignoreAllMessages()
Voluntarily ignore all messages to signify they should not need to be asserted.
|
void |
ignoreMessage(int position)
Voluntarily ignore a message to signify it should not need to be asserted.
|
int |
size() |
public AllLogRule()
public AllLogRule(LogLevel level)
level
- the level of log to capturepublic org.junit.runners.model.Statement apply(org.junit.runners.model.Statement statement, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
public ch.qos.logback.classic.spi.ILoggingEvent getLogEvent(int position)
position
- the message number in the list of captured logspublic String getMessage(int position)
position
- the message number in the list of captured logspublic org.slf4j.Marker getMarker(int position)
position
- the message number in the list of captured logspublic int size()
public void ignoreAllMessages()
public void ignoreMessage(int position)
position
- the message number in the list of captured logsCopyright © 2004–2019 XWiki. All rights reserved.