Package com.cedarsolutions.util.JavaLoggingFormatter

Examples of com.cedarsolutions.util.JavaLoggingFormatter.LogInfo


        when(record.getMillis()).thenReturn(now.getTime());
        when(record.getLevel()).thenReturn(java.util.logging.Level.INFO);
        when(record.getSourceClassName()).thenReturn("test.class.Name");
        when(record.getMessage()).thenReturn("message");

        LogInfo info = new LogInfo(record);
        assertNotNull(info);
        assertEquals(now, info.getDate());
        assertEquals(org.apache.log4j.Level.INFO, info.getLevel());
        assertEquals("test.class.Name", info.getClassName());
        assertEquals("message", info.getMessage());

        String zone = DateUtils.formatDate(now, "Z"); // like "-0500"
        assertEquals("2011-10-07 13:01:42,663 " + zone + " [INFO ] --> [test.class.Name] message" + StringUtils.LINE_ENDING, info.format());
    }
View Full Code Here


                                                                       org.apache.log4j.Level.ALL, };

        for (int i = 0; i < input.length; i++) {
            LogRecord record = mock(LogRecord.class);
            when(record.getLevel()).thenReturn(input[i]);
            LogInfo info = new LogInfo(record);
            assertEquals(output[i], info.getLevel());
        }
    }
View Full Code Here

TOP

Related Classes of com.cedarsolutions.util.JavaLoggingFormatter.LogInfo

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.