public class OutputStreamAppenderTest {
@Test
public void testAppender() {
final Layout<String> layout = PatternLayout.createLayout(null, null, null, null, null, null);
final InMemoryAppender app = new InMemoryAppender("test", layout, null, false);
final LogEvent event = new Log4jLogEvent("TestLogger", null, OutputStreamAppenderTest.class.getName(), Level.INFO,
new SimpleMessage("Test"), null);
app.start();
assertTrue("Appender did not start", app.isStarted());
app.append(event);
final String msg = app.toString();
assertNotNull("No message", msg);
assertTrue("Incorrect message: " + msg , msg.endsWith("Test" + Constants.LINE_SEP));
app.stop();
assertFalse("Appender did not stop", app.isStarted());
}