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