Package org.slf4j.impl

Examples of org.slf4j.impl.Log4jLoggerAdapter


    private UnitOfWork unitOfWork;

    @Before
    public void setUp() throws Exception {
        testSubject = new LoggingInterceptor();
        Log4jLoggerAdapter logger = (Log4jLoggerAdapter) LoggerFactory.getLogger(LoggingInterceptor.class);
        Field loggerField = logger.getClass().getDeclaredField("logger");
        ReflectionUtils.makeAccessible(loggerField);
        mockLogger = mock(Logger.class);
        loggerField.set(logger, mockLogger);
        interceptorChain = mock(InterceptorChain.class);
        unitOfWork = mock(UnitOfWork.class);
View Full Code Here


    @Test
    public void testConstructorWithCustomLogger() throws Exception {
        testSubject = new LoggingInterceptor("my.custom.logger");
        Field field = testSubject.getClass().getDeclaredField("logger");
        field.setAccessible(true);
        Log4jLoggerAdapter logger = (Log4jLoggerAdapter) field.get(testSubject);
        assertEquals("my.custom.logger", logger.getName());
    }
View Full Code Here

TOP

Related Classes of org.slf4j.impl.Log4jLoggerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.