1 7 8 package org.jzonic.jlo; 9 10 import junit.framework.Test; 11 import junit.framework.TestCase; 12 import junit.framework.TestSuite; 13 import org.jzonic.jlo.handler.MockHandler; 14 18 public class LoggingTest extends TestCase { 19 20 public LoggingTest(java.lang.String testName) { 21 super(testName); 22 } 23 24 public static void main(java.lang.String [] args) { 25 junit.textui.TestRunner.run(suite()); 26 } 27 28 public static Test suite() { 29 TestSuite suite = new TestSuite(LoggingTest.class); 30 return suite; 31 } 32 33 public void testLogging() { 34 Logger logger = LogManager.getLogger("org.jzonic.jlo"); 35 logger.info("Hello"); 36 LogGenerator lg = (LogGenerator)logger.getLogGenerators().get(0); 37 MockHandler handler = (MockHandler)lg.getHandler(); 38 assertEquals(1,handler.getMessages().size()); 39 } 40 54 } 55 | Popular Tags |