1   /*
2      Copyright 2002-2006 Martin van den Bemt
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  package org.xulux.logging;
17  
18  import org.apache.commons.logging.impl.SimpleLog;
19  
20  import junit.framework.TestCase;
21  
22  /**
23   * @author <a href="mailto:martin@mvdb.net">Martin van den Bemt</a>
24   * @version $Id: CommonsLoggingTest.java,v 1.1 2005/12/18 12:58:20 mvdb Exp $
25   */
26  
27  public class CommonsLoggingTest extends TestCase {
28  
29      static {
30          System.setProperty("org.apache.commons.logging.Log", SimpleLog.class.getName());
31  //        System.setProperty("org.apache.commons.logging.simplelog.defaultlog", )
32      }
33      /**
34       * Constructor for CommonsLoggingTest.
35       * @param name the name of the test
36       */
37      public CommonsLoggingTest(String name) {
38          super(name);
39      }
40      
41      public void testInitDestroy() {
42          System.out.println("testInitDestroy");
43          CommonsLogging cl = new CommonsLogging();
44          cl.init();
45          cl.destroy();
46      }
47      
48      public void testLog() {
49          System.out.println("testLog");
50          CommonsLogging cl = new CommonsLogging();
51          // don't crash on this..
52          cl.log(0, null, null);
53          cl.log(0, "test", null);
54      }
55      
56      public void testLogException() {
57          System.out.println("testLogException");
58          CommonsLogging cl = new CommonsLogging();
59          cl.log(0, null, null, null);
60          cl.log(0, "test", null, null);
61      }
62  
63  }