Search in sources :

Example 86 with Log

use of org.apache.commons.logging.Log in project netty by netty.

the class CommonsLoggerTest method testErrorWithException.

@Test
public void testErrorWithException() {
    Log mockLog = mock(Log.class);
    InternalLogger logger = new CommonsLogger(mockLog, "foo");
    logger.error("a", e);
    verify(mockLog).error("a", e);
}
Also used : Log(org.apache.commons.logging.Log) Test(org.junit.jupiter.api.Test)

Example 87 with Log

use of org.apache.commons.logging.Log in project netty by netty.

the class CommonsLoggerTest method testIsWarnEnabled.

@Test
public void testIsWarnEnabled() {
    Log mockLog = mock(Log.class);
    when(mockLog.isWarnEnabled()).thenReturn(true);
    InternalLogger logger = new CommonsLogger(mockLog, "foo");
    assertTrue(logger.isWarnEnabled());
    verify(mockLog).isWarnEnabled();
}
Also used : Log(org.apache.commons.logging.Log) Test(org.junit.jupiter.api.Test)

Example 88 with Log

use of org.apache.commons.logging.Log in project netty by netty.

the class CommonsLoggerTest method testDebug.

@Test
public void testDebug() {
    Log mockLog = mock(Log.class);
    InternalLogger logger = new CommonsLogger(mockLog, "foo");
    logger.debug("a");
    verify(mockLog).debug("a");
}
Also used : Log(org.apache.commons.logging.Log) Test(org.junit.jupiter.api.Test)

Example 89 with Log

use of org.apache.commons.logging.Log in project netty by netty.

the class CommonsLoggerTest method testTrace.

@Test
public void testTrace() {
    Log mockLog = mock(Log.class);
    InternalLogger logger = new CommonsLogger(mockLog, "foo");
    logger.trace("a");
    verify(mockLog).trace("a");
}
Also used : Log(org.apache.commons.logging.Log) Test(org.junit.jupiter.api.Test)

Example 90 with Log

use of org.apache.commons.logging.Log in project netty by netty.

the class CommonsLoggerTest method testIsDebugEnabled.

@Test
public void testIsDebugEnabled() {
    Log mockLog = mock(Log.class);
    when(mockLog.isDebugEnabled()).thenReturn(true);
    InternalLogger logger = new CommonsLogger(mockLog, "foo");
    assertTrue(logger.isDebugEnabled());
    verify(mockLog).isDebugEnabled();
}
Also used : Log(org.apache.commons.logging.Log) Test(org.junit.jupiter.api.Test)

Aggregations

Log (org.apache.commons.logging.Log)188 Test (org.junit.Test)51 Test (org.junit.jupiter.api.Test)40 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)35 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)19 BeanFactory (org.springframework.beans.factory.BeanFactory)17 CountDownLatch (java.util.concurrent.CountDownLatch)15 LogConfigurationException (org.apache.commons.logging.LogConfigurationException)15 ArrayList (java.util.ArrayList)12 File (java.io.File)11 QueueChannel (org.springframework.integration.channel.QueueChannel)11 MethodInvocation (org.aopalliance.intercept.MethodInvocation)10 IOException (java.io.IOException)9 AtomicReference (java.util.concurrent.atomic.AtomicReference)9 Log4JLogger (org.apache.commons.logging.impl.Log4JLogger)9 Message (org.springframework.messaging.Message)8 List (java.util.List)7 ApplicationEventPublisher (org.springframework.context.ApplicationEventPublisher)7 InputStream (java.io.InputStream)6 LogFactory (org.apache.commons.logging.LogFactory)6