01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: 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: package org.apache.poi.util;
19:
20: import junit.framework.TestCase;
21:
22: /**
23: * Tests the log class.
24: *
25: * @author Glen Stampoultzis (glens at apache.org)
26: * @author Marc Johnson (mjohnson at apache dot org)
27: * @author Nicola Ken Barozzi (nicolaken at apache.org)
28: */
29:
30: public class TestPOILogger extends TestCase {
31: /**
32: * Constructor TestPOILogger
33: *
34: *
35: * @param s
36: *
37: */
38:
39: public TestPOILogger(String s) {
40: super (s);
41: }
42:
43: /**
44: * Test different types of log output.
45: *
46: * @exception Exception
47: */
48: public void testVariousLogTypes() throws Exception {
49: //NKB Testing only that logging classes use gives no exception
50: // Since logging can be disabled, no checking of logging
51: // output is done.
52:
53: POILogger log = POILogFactory.getLogger("foo");
54:
55: log.log(POILogger.WARN, "Test = ", new Integer(1));
56: log.logFormatted(POILogger.ERROR,
57: "Test param 1 = %, param 2 = %", "2", new Integer(3));
58: log.logFormatted(POILogger.ERROR,
59: "Test param 1 = %, param 2 = %", new int[] { 4, 5 });
60: log.logFormatted(POILogger.ERROR,
61: "Test param 1 = %1.1, param 2 = %0.1", new double[] {
62: 4, 5.23 });
63:
64: }
65: }
|