1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.logging.log4j.log4j12;
18
19 import java.util.List;
20
21 import org.apache.commons.logging.log4j.StandardTests;
22 import org.apache.log4j.Level;
23 import org.apache.log4j.Logger;
24
25 /***
26 * A concrete class that runs the standard tests, and is compiled
27 * specifically against log4j12. The parent class can't call any
28 * log4j methods at all as that would mean it has to be compiled
29 * against a particular version of log4j.
30 */
31
32 public class Log4j12StandardTests extends StandardTests {
33
34 public void setUpTestAppender(List logEvents) {
35 TestAppender appender = new TestAppender(logEvents);
36 Logger rootLogger = Logger.getRootLogger();
37 rootLogger.removeAllAppenders();
38 rootLogger.addAppender(appender);
39 rootLogger.setLevel(Level.INFO);
40 }
41 }