1 33 34 35 package org.apache.commons.logging; 36 37 import junit.framework.TestCase; 38 39 40 public class InvokeJCLTest extends TestCase { 41 42 public void testIsEnabledAPI() { 43 Log log = LogFactory.getLog(InvokeJCLTest.class); 45 assertFalse(log.isTraceEnabled()); 46 assertFalse(log.isDebugEnabled()); 47 assertTrue(log.isInfoEnabled()); 48 assertTrue(log.isWarnEnabled()); 49 assertTrue(log.isErrorEnabled()); 50 assertTrue(log.isFatalEnabled()); 51 } 52 53 public void testPrintAPI() { 54 Log log = LogFactory.getLog(InvokeJCLTest.class); 55 Exception e = new Exception ("just testing"); 56 57 log.trace(null); 58 log.trace("trace message"); 59 60 log.debug(null); 61 log.debug("debug message"); 62 63 log.info(null); 64 log.info("info message"); 65 66 log.warn(null); 67 log.warn("warn message"); 68 69 log.error(null); 70 log.error("error message"); 71 72 log.fatal(null); 73 log.fatal("fatal message"); 74 75 76 log.trace(null, e); 77 log.trace("trace message", e); 78 79 log.debug(null, e); 80 log.debug("debug message", e); 81 82 log.info(null, e); 83 log.info("info message", e); 84 85 log.warn(null, e); 86 log.warn("warn message", e); 87 88 log.error(null, e); 89 log.error("error message", e); 90 91 log.fatal(null, e); 92 log.fatal("fatal message", e); 93 } 94 } 95 | Popular Tags |