KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > util > TestPOILogFactory


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

17         
18
19 package org.apache.poi.util;
20
21 import junit.framework.TestCase;
22
23 import java.io.IOException JavaDoc;
24
25 /**
26  * @author Marc Johnson (mjohnson at apache dot org)
27  * @author Glen Stampoultzis (glens at apache.org)
28  * @author Nicola Ken Barozzi (nicolaken at apache.org)
29  */

30
31 public class TestPOILogFactory
32         extends TestCase
33 {
34     /**
35      * Creates new TestPOILogFactory
36      *
37      * @param name
38      */

39
40     public TestPOILogFactory( String JavaDoc name )
41     {
42         super( name );
43     }
44
45     /**
46      * test log creation
47      *
48      * @exception IOException
49      */

50
51     public void testLog()
52             throws IOException JavaDoc
53     {
54         //NKB Testing only that logging classes use gives no exception
55
// Since logging can be disabled, no checking of logging
56
// output is done.
57

58         POILogger l1 = POILogFactory.getLogger( "org.apache.poi.hssf.test" );
59         POILogger l2 = POILogFactory.getLogger( "org.apache.poi.hdf.test" );
60
61         l1.log( POILogger.FATAL, "testing cat org.apache.poi.hssf.*:FATAL" );
62         l1.log( POILogger.ERROR, "testing cat org.apache.poi.hssf.*:ERROR" );
63         l1.log( POILogger.WARN, "testing cat org.apache.poi.hssf.*:WARN" );
64         l1.log( POILogger.INFO, "testing cat org.apache.poi.hssf.*:INFO" );
65         l1.log( POILogger.DEBUG, "testing cat org.apache.poi.hssf.*:DEBUG" );
66
67         l2.log( POILogger.FATAL, "testing cat org.apache.poi.hdf.*:FATAL" );
68         l2.log( POILogger.ERROR, "testing cat org.apache.poi.hdf.*:ERROR" );
69         l2.log( POILogger.WARN, "testing cat org.apache.poi.hdf.*:WARN" );
70         l2.log( POILogger.INFO, "testing cat org.apache.poi.hdf.*:INFO" );
71         l2.log( POILogger.DEBUG, "testing cat org.apache.poi.hdf.*:DEBUG" );
72
73     }
74
75     /**
76      * main method to run the unit tests
77      *
78      * @param ignored_args
79      */

80
81     public static void main( String JavaDoc[] ignored_args )
82     {
83         System.out.println( "Testing basic util.POILogFactory functionality" );
84         junit.textui.TestRunner.run( TestPOILogFactory.class );
85     }
86 }
87
Popular Tags