1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.logging;
19
20 import junit.framework.*;
21
22
23 /***
24 *
25 * @author Sean C. Sullivan
26 * @version $Revision: $
27 *
28 */
29 public abstract class AbstractLogTest extends TestCase {
30
31 public AbstractLogTest(String testName) {
32 super(testName);
33 }
34
35
36 public abstract Log getLogObject();
37
38 public void testLoggingWithNullParameters()
39 {
40 Log log = this.getLogObject();
41
42 assertNotNull(log);
43
44
45 log.debug(null);
46
47 log.debug(null, null);
48
49 log.debug(log.getClass().getName() + ": debug statement");
50
51 log.debug(log.getClass().getName() + ": debug statement w/ null exception", new RuntimeException());
52
53
54 log.error(null);
55
56 log.error(null, null);
57
58 log.error(log.getClass().getName() + ": error statement");
59
60 log.error(log.getClass().getName() + ": error statement w/ null exception", new RuntimeException());
61
62
63 log.fatal(null);
64
65 log.fatal(null, null);
66
67 log.fatal(log.getClass().getName() + ": fatal statement");
68
69 log.fatal(log.getClass().getName() + ": fatal statement w/ null exception", new RuntimeException());
70
71
72 log.info(null);
73
74 log.info(null, null);
75
76 log.info(log.getClass().getName() + ": info statement");
77
78 log.info(log.getClass().getName() + ": info statement w/ null exception", new RuntimeException());
79
80
81 log.trace(null);
82
83 log.trace(null, null);
84
85 log.trace(log.getClass().getName() + ": trace statement");
86
87 log.trace(log.getClass().getName() + ": trace statement w/ null exception", new RuntimeException());
88
89
90 log.warn(null);
91
92 log.warn(null, null);
93
94 log.warn(log.getClass().getName() + ": warn statement");
95
96 log.warn(log.getClass().getName() + ": warn statement w/ null exception", new RuntimeException());
97 }
98 }