use of org.apache.logging.log4j.spi.MessageFactory2Adapter in project logging-log4j2 by apache.
the class LoggerTest method checkMessageFactory.
private static void checkMessageFactory(final MessageFactory messageFactory1, final Logger testLogger1) {
if (messageFactory1 == null) {
assertEquals(AbstractLogger.DEFAULT_MESSAGE_FACTORY_CLASS, testLogger1.getMessageFactory().getClass());
} else {
MessageFactory actual = testLogger1.getMessageFactory();
if (actual instanceof MessageFactory2Adapter) {
actual = ((MessageFactory2Adapter) actual).getOriginal();
}
assertEquals(messageFactory1, actual);
}
}
use of org.apache.logging.log4j.spi.MessageFactory2Adapter in project logging-log4j2 by apache.
the class LoggerTest method assertEqualMessageFactory.
private void assertEqualMessageFactory(final MessageFactory messageFactory, final TestLogger testLogger) {
MessageFactory actual = testLogger.getMessageFactory();
if (actual instanceof MessageFactory2Adapter) {
actual = ((MessageFactory2Adapter) actual).getOriginal();
}
assertEquals(messageFactory, actual);
}
use of org.apache.logging.log4j.spi.MessageFactory2Adapter in project logging-log4j2 by apache.
the class LoggerTest method checkMessageFactory.
private static void checkMessageFactory(final MessageFactory messageFactory1, final Logger testLogger1) {
if (messageFactory1 == null) {
assertEquals(AbstractLogger.DEFAULT_MESSAGE_FACTORY_CLASS, testLogger1.getMessageFactory().getClass());
} else {
MessageFactory actual = testLogger1.getMessageFactory();
if (actual instanceof MessageFactory2Adapter) {
actual = ((MessageFactory2Adapter) actual).getOriginal();
}
assertEquals(messageFactory1, actual);
}
}
use of org.apache.logging.log4j.spi.MessageFactory2Adapter in project logging-log4j2 by apache.
the class SetLoggerTagTest method checkMessageFactory.
private static void checkMessageFactory(final String msg, final MessageFactory messageFactory1, final Logger testLogger1) {
if (messageFactory1 == null) {
assertEquals(msg, AbstractLogger.DEFAULT_MESSAGE_FACTORY_CLASS, testLogger1.getMessageFactory().getClass());
} else {
MessageFactory actual = testLogger1.getMessageFactory();
if (actual instanceof MessageFactory2Adapter) {
actual = ((MessageFactory2Adapter) actual).getOriginal();
}
assertEquals(msg, messageFactory1, actual);
}
}
Aggregations