Search in sources :

Example 1 with ReusableObjectMessage

use of org.apache.logging.log4j.message.ReusableObjectMessage in project logging-log4j2 by apache.

the class Log4jLogEventTest method testToImmutableNotSame.

@Test
public void testToImmutableNotSame() {
    final LogEvent logEvent = new Log4jLogEvent.Builder().setMessage(new ReusableObjectMessage()).build();
    final LogEvent immutable = logEvent.toImmutable();
    assertSame(logEvent, immutable);
    assertFalse(immutable.getMessage() instanceof ReusableMessage);
}
Also used : LogEvent(org.apache.logging.log4j.core.LogEvent) ReusableMessage(org.apache.logging.log4j.message.ReusableMessage) ReusableObjectMessage(org.apache.logging.log4j.message.ReusableObjectMessage) ClockFactoryTest(org.apache.logging.log4j.core.time.ClockFactoryTest) Test(org.junit.jupiter.api.Test)

Aggregations

LogEvent (org.apache.logging.log4j.core.LogEvent)1 ClockFactoryTest (org.apache.logging.log4j.core.time.ClockFactoryTest)1 ReusableMessage (org.apache.logging.log4j.message.ReusableMessage)1 ReusableObjectMessage (org.apache.logging.log4j.message.ReusableObjectMessage)1 Test (org.junit.jupiter.api.Test)1