1   /*
2    * Copyright 2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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  }