1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.logging;
18
19 import junit.framework.TestCase;
20
21
22
23
24
25
26 public abstract class AbstractLogTest extends TestCase {
27
28 public abstract Log getLogObject();
29
30 public void testLoggingWithNullParameters()
31 {
32 final Log log = this.getLogObject();
33 assertNotNull(log);
34
35 log.debug(null);
36 log.debug(null, null);
37 log.debug(log.getClass().getName() + ": debug statement");
38 log.debug(log.getClass().getName() + ": debug statement w/ null exception", new RuntimeException());
39
40 log.error(null);
41 log.error(null, null);
42 log.error(log.getClass().getName() + ": error statement");
43 log.error(log.getClass().getName() + ": error statement w/ null exception", new RuntimeException());
44
45 log.fatal(null);
46 log.fatal(null, null);
47 log.fatal(log.getClass().getName() + ": fatal statement");
48 log.fatal(log.getClass().getName() + ": fatal statement w/ null exception", new RuntimeException());
49
50 log.info(null);
51 log.info(null, null);
52 log.info(log.getClass().getName() + ": info statement");
53 log.info(log.getClass().getName() + ": info statement w/ null exception", new RuntimeException());
54
55 log.trace(null);
56 log.trace(null, null);
57 log.trace(log.getClass().getName() + ": trace statement");
58 log.trace(log.getClass().getName() + ": trace statement w/ null exception", new RuntimeException());
59
60 log.warn(null);
61 log.warn(null, null);
62 log.warn(log.getClass().getName() + ": warn statement");
63 log.warn(log.getClass().getName() + ": warn statement w/ null exception", new RuntimeException());
64 }
65 }