use of org.apache.logging.log4j.test.appender.InMemoryAppender in project logging-log4j2 by apache.
the class InMemoryAppenderTest method testHeaderRequested.
@Test
public void testHeaderRequested() {
final PatternLayout layout = PatternLayout.newBuilder().withHeader("HEADERHEADER").build();
final boolean writeHeader = true;
final InMemoryAppender app = new InMemoryAppender("test", layout, null, false, writeHeader);
final String expectedHeader = "HEADERHEADER";
assertMessage("Test", app, expectedHeader);
}
use of org.apache.logging.log4j.test.appender.InMemoryAppender in project logging-log4j2 by apache.
the class InMemoryAppenderTest method testAppender.
@Test
public void testAppender() {
final Layout<String> layout = PatternLayout.createDefaultLayout();
final boolean writeHeader = true;
final InMemoryAppender app = new InMemoryAppender("test", layout, null, false, writeHeader);
final String expectedHeader = null;
assertMessage("Test", app, expectedHeader);
}
use of org.apache.logging.log4j.test.appender.InMemoryAppender in project logging-log4j2 by apache.
the class InMemoryAppenderTest method testHeaderSuppressed.
@Test
public void testHeaderSuppressed() {
final PatternLayout layout = PatternLayout.newBuilder().withHeader("HEADERHEADER").build();
final boolean writeHeader = false;
final InMemoryAppender app = new InMemoryAppender("test", layout, null, false, writeHeader);
final String expectedHeader = null;
assertMessage("Test", app, expectedHeader);
}
Aggregations