01: package org.apache.ojb.broker;
02:
03: //JUNIT
04:
05: import junit.framework.Test;
06: import junit.framework.TestCase;
07: import junit.framework.TestSuite;
08: import org.apache.ojb.broker.accesslayer.RsIterator;
09: 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: * This TestCase contains the OJB performance benchmarks for the
15: * PersistenceBroker API.
16: * @author Thomas Mahler
17: */
18: public class LogServiceTest extends TestCase {
19: public static void main(String[] args) {
20: String[] arr = { LogServiceTest.class.getName() };
21: junit.textui.TestRunner.main(arr);
22: }
23:
24: public LogServiceTest(String name)
25:
26: {
27: super (name);
28: }
29:
30: /**
31: * Return the Test
32: */
33: public static Test suite() {
34: return new TestSuite(LogServiceTest.class);
35: }
36:
37: public void testLogggers() throws Exception {
38: String prefix = "Ignore this!! LOGGING TEST OUTPUT: ";
39: Logger pbroker = LoggerFactory
40: .getLogger(PersistenceBrokerImpl.class);
41: Logger rsiterator = LoggerFactory.getLogger(RsIterator.class);
42: Logger boot = LoggerFactory.getBootLogger();
43:
44: pbroker = LoggerFactory.getLogger(PersistenceBrokerImpl.class);
45: rsiterator = LoggerFactory.getLogger(RsIterator.class);
46:
47: pbroker.debug(prefix + "Should be with DEBUG level");
48: pbroker.info(prefix + "Should be with INFO level");
49: pbroker.warn(prefix + "Should be with WARN level");
50:
51: rsiterator.debug(prefix + "Should be with DEBUG level");
52: rsiterator.info(prefix + "Should be with INFO level");
53: rsiterator.warn(prefix + "Should be with WARN level");
54:
55: boot.debug(prefix + "Should be with DEBUG level");
56: boot.info(prefix + "Should be with INFO level");
57: boot.warn(prefix + "Should be with WARN level");
58: }
59: }
|