2 /* ====================================================================
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================== */
20 package org
.apache
.poi
.util
;
22 import junit
.framework
.TestCase
;
25 * Tests the log class.
27 * @author Glen Stampoultzis (glens at apache.org)
28 * @author Marc Johnson (mjohnson at apache dot org)
29 * @author Nicola Ken Barozzi (nicolaken at apache.org)
32 public class TestPOILogger
36 * Constructor TestPOILogger
43 public TestPOILogger( String s
)
49 * Test different types of log output.
51 * @exception Exception
53 public void testVariousLogTypes()
56 //NKB Testing only that logging classes use gives no exception
57 // Since logging can be disabled, no checking of logging
60 POILogger log
= POILogFactory
.getLogger( "foo" );
62 log
.log( POILogger
.WARN
, "Test = ", new Integer( 1 ) );
63 log
.logFormatted( POILogger
.ERROR
, "Test param 1 = %, param 2 = %", "2", new Integer( 3 ) );
64 log
.logFormatted( POILogger
.ERROR
, "Test param 1 = %, param 2 = %", new int[]{4, 5} );
65 log
.logFormatted( POILogger
.ERROR
,
66 "Test param 1 = %1.1, param 2 = %0.1", new double[]{4, 5.23} );