1 package org.apache.ojb.broker; 2 3 5 import junit.framework.Test; 6 import junit.framework.TestCase; 7 import junit.framework.TestSuite; 8 import org.apache.ojb.broker.accesslayer.RsIterator; 9 import org.apache.ojb.broker.core.PersistenceBrokerImpl; 10 import org.apache.ojb.broker.util.logging.Logger; 11 import org.apache.ojb.broker.util.logging.LoggerFactory; 12 13 14 19 public class LogServiceTest 20 extends TestCase 21 { 22 public static void main(String [] args) 23 { 24 String [] arr = {LogServiceTest.class.getName()}; 25 junit.textui.TestRunner.main(arr); 26 } 27 28 public LogServiceTest(String name) 29 30 { 31 super(name); 32 } 33 34 37 public static Test suite() 38 { 39 return new TestSuite(LogServiceTest.class); 40 } 41 42 43 public void testLogggers() throws Exception 44 { 45 String prefix = "Ignore this!! LOGGING TEST OUTPUT: "; 46 Logger pbroker = LoggerFactory.getLogger(PersistenceBrokerImpl.class); 47 Logger rsiterator = LoggerFactory.getLogger(RsIterator.class); 48 Logger boot = LoggerFactory.getBootLogger(); 49 50 pbroker = LoggerFactory.getLogger(PersistenceBrokerImpl.class); 51 rsiterator = LoggerFactory.getLogger(RsIterator.class); 52 53 pbroker.debug(prefix + "Should be with DEBUG level"); 54 pbroker.info(prefix + "Should be with INFO level"); 55 pbroker.warn(prefix + "Should be with WARN level"); 56 57 rsiterator.debug(prefix + "Should be with DEBUG level"); 58 rsiterator.info(prefix + "Should be with INFO level"); 59 rsiterator.warn(prefix + "Should be with WARN level"); 60 61 boot.debug(prefix + "Should be with DEBUG level"); 62 boot.info(prefix + "Should be with INFO level"); 63 boot.warn(prefix + "Should be with WARN level"); 64 } 65 } 66 | Popular Tags |