KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > LogServiceTest


1 package org.apache.ojb.broker;
2
3 //JUNIT
4

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 /**
15  * This TestCase contains the OJB performance benchmarks for the
16  * PersistenceBroker API.
17  * @author Thomas Mahler
18  */

19 public class LogServiceTest
20         extends TestCase
21 {
22     public static void main(String JavaDoc[] args)
23     {
24         String JavaDoc[] arr = {LogServiceTest.class.getName()};
25         junit.textui.TestRunner.main(arr);
26     }
27
28     public LogServiceTest(String JavaDoc name)
29
30     {
31         super(name);
32     }
33
34     /**
35      * Return the Test
36      */

37     public static Test suite()
38     {
39         return new TestSuite(LogServiceTest.class);
40     }
41
42
43     public void testLogggers() throws Exception JavaDoc
44     {
45         String JavaDoc 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