public class LoggerTest.LogRecorder extends org.apache.log4j.WriterAppender
validated to ensure that the log contains
messages in the proper order and with the proper content.| Constructor and Description |
|---|
LogRecorder() |
LogRecorder(StringWriter writer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasEvents() |
org.apache.log4j.spi.LoggingEvent |
removeFirst() |
void |
removeFirst(org.modeshape.common.logging.Logger.Level expectedLevel,
String expectedMessageExpression) |
void |
removeFirst(org.modeshape.common.logging.Logger.Level expectedLevel,
String expectedMessageExpression,
Class<? extends Throwable> expectedExceptionClass)
Remove the message that is currently at the front of the log, and verify that it contains the supplied information.
|
protected void |
subAppend(org.apache.log4j.spi.LoggingEvent event) |
activateOptions, append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, reset, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, writeFooter, writeHeaderpublic LogRecorder(StringWriter writer)
public LogRecorder()
protected void subAppend(org.apache.log4j.spi.LoggingEvent event)
subAppend in class org.apache.log4j.WriterAppenderpublic org.apache.log4j.spi.LoggingEvent removeFirst()
public boolean hasEvents()
public void removeFirst(org.modeshape.common.logging.Logger.Level expectedLevel, String expectedMessageExpression, Class<? extends Throwable> expectedExceptionClass)
expectedLevel - the level that the next log message should haveexpectedMessageExpression - the message that the next log message should have, or a regular expression that would
match the log messageexpectedExceptionClass - the exception class that was expected, or null if there should not be an exceptionpublic void removeFirst(org.modeshape.common.logging.Logger.Level expectedLevel, String expectedMessageExpression)
Copyright © 2008–2021 JBoss, a division of Red Hat. All rights reserved.