diff options
author | Glen Stampoultzis <glens@apache.org> | 2002-06-15 06:04:26 +0000 |
---|---|---|
committer | Glen Stampoultzis <glens@apache.org> | 2002-06-15 06:04:26 +0000 |
commit | c9a239b582b2b99d249a91e6822e131b955d51cb (patch) | |
tree | 33b771931596bf9a8078d2680d480566e13ee0b5 /src/testcases/org/apache/poi/util | |
parent | 5aff3f3ca1f2e878e3eb0b971ee78125c0ff0b6b (diff) | |
download | poi-c9a239b582b2b99d249a91e6822e131b955d51cb.tar.gz poi-c9a239b582b2b99d249a91e6822e131b955d51cb.zip |
Various changes. SST refactoring which I'm not sure is worth it because I'm pretty sure SST recordsize calculation is all wrong. Added some logging stuff and also merged some stuff from 1.5 branch
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/util')
-rw-r--r-- | src/testcases/org/apache/poi/util/TestPOILogFactory.java | 47 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/util/TestPOILogger.java | 51 |
2 files changed, 34 insertions, 64 deletions
diff --git a/src/testcases/org/apache/poi/util/TestPOILogFactory.java b/src/testcases/org/apache/poi/util/TestPOILogFactory.java index 82aef5d5c1..2e27e6a9ba 100644 --- a/src/testcases/org/apache/poi/util/TestPOILogFactory.java +++ b/src/testcases/org/apache/poi/util/TestPOILogFactory.java @@ -1,4 +1,3 @@ - /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -55,11 +54,9 @@ package org.apache.poi.util; -import org.apache.log4j.Category; - -import junit.framework.*; +import junit.framework.TestCase; -import java.io.*; +import java.io.IOException; /** * @author Marc Johnson (mjohnson at apache dot org) @@ -68,7 +65,7 @@ import java.io.*; */ public class TestPOILogFactory - extends TestCase + extends TestCase { /** * Creates new TestPOILogFactory @@ -76,9 +73,9 @@ public class TestPOILogFactory * @param name */ - public TestPOILogFactory(String name) + public TestPOILogFactory( String name ) { - super(name); + super( name ); } /** @@ -88,26 +85,26 @@ public class TestPOILogFactory */ public void testLog() - throws IOException + throws IOException { //NKB Testing only that logging classes use gives no exception // Since logging can be disabled, no checking of logging // output is done. - - POILogger l1 = POILogFactory.getLogger("org.apache.poi.hssf.test"); - POILogger l2 = POILogFactory.getLogger("org.apache.poi.hdf.test"); - l1.log(POILogger.FATAL, "testing cat org.apache.poi.hssf.*:FATAL"); - l1.log(POILogger.ERROR, "testing cat org.apache.poi.hssf.*:ERROR"); - l1.log(POILogger.WARN, "testing cat org.apache.poi.hssf.*:WARN"); - l1.log(POILogger.INFO, "testing cat org.apache.poi.hssf.*:INFO"); - l1.log(POILogger.DEBUG, "testing cat org.apache.poi.hssf.*:DEBUG"); + POILogger l1 = POILogFactory.getLogger( "org.apache.poi.hssf.test" ); + POILogger l2 = POILogFactory.getLogger( "org.apache.poi.hdf.test" ); + + l1.log( POILogger.FATAL, "testing cat org.apache.poi.hssf.*:FATAL" ); + l1.log( POILogger.ERROR, "testing cat org.apache.poi.hssf.*:ERROR" ); + l1.log( POILogger.WARN, "testing cat org.apache.poi.hssf.*:WARN" ); + l1.log( POILogger.INFO, "testing cat org.apache.poi.hssf.*:INFO" ); + l1.log( POILogger.DEBUG, "testing cat org.apache.poi.hssf.*:DEBUG" ); - l2.log(POILogger.FATAL, "testing cat org.apache.poi.hdf.*:FATAL"); - l2.log(POILogger.ERROR, "testing cat org.apache.poi.hdf.*:ERROR"); - l2.log(POILogger.WARN, "testing cat org.apache.poi.hdf.*:WARN"); - l2.log(POILogger.INFO, "testing cat org.apache.poi.hdf.*:INFO"); - l2.log(POILogger.DEBUG, "testing cat org.apache.poi.hdf.*:DEBUG"); + l2.log( POILogger.FATAL, "testing cat org.apache.poi.hdf.*:FATAL" ); + l2.log( POILogger.ERROR, "testing cat org.apache.poi.hdf.*:ERROR" ); + l2.log( POILogger.WARN, "testing cat org.apache.poi.hdf.*:WARN" ); + l2.log( POILogger.INFO, "testing cat org.apache.poi.hdf.*:INFO" ); + l2.log( POILogger.DEBUG, "testing cat org.apache.poi.hdf.*:DEBUG" ); } @@ -117,9 +114,9 @@ public class TestPOILogFactory * @param ignored_args */ - public static void main(String [] ignored_args) + public static void main( String[] ignored_args ) { - System.out.println("Testing basic util.POILogFactory functionality"); - junit.textui.TestRunner.run(TestPOILogFactory.class); + System.out.println( "Testing basic util.POILogFactory functionality" ); + junit.textui.TestRunner.run( TestPOILogFactory.class ); } } diff --git a/src/testcases/org/apache/poi/util/TestPOILogger.java b/src/testcases/org/apache/poi/util/TestPOILogger.java index 62b47a24a4..46248b5e21 100644 --- a/src/testcases/org/apache/poi/util/TestPOILogger.java +++ b/src/testcases/org/apache/poi/util/TestPOILogger.java @@ -1,4 +1,3 @@ - /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -57,19 +56,16 @@ package org.apache.poi.util; import junit.framework.TestCase; -import java.io.File; -import java.io.FileInputStream; - /** * Tests the log class. * * @author Glen Stampoultzis (glens at apache.org) * @author Marc Johnson (mjohnson at apache dot org) - * @author Nicola Ken Barozzi (nicolaken at apache.org) + * @author Nicola Ken Barozzi (nicolaken at apache.org) */ public class TestPOILogger - extends TestCase + extends TestCase { /** * Constructor TestPOILogger @@ -79,23 +75,9 @@ public class TestPOILogger * */ - public TestPOILogger(String s) - { - super(s); - } - - /** - * Method setUp - * - * - * @exception Exception - * - */ - - protected void setUp() - throws Exception + public TestPOILogger( String s ) { - super.setUp(); + super( s ); } /** @@ -103,29 +85,20 @@ public class TestPOILogger * * @exception Exception */ - public void testVariousLogTypes() - throws Exception + throws Exception { //NKB Testing only that logging classes use gives no exception // Since logging can be disabled, no checking of logging // output is done. - - POILogger log = POILogFactory.getLogger("foo"); - log.log(POILogger.WARN, "Test = ", new Integer(1)); - log.logFormatted(POILogger.ERROR, "Test param 1 = %, param 2 = %", - "2", new Integer(3)); - log.logFormatted(POILogger.ERROR, "Test param 1 = %, param 2 = %", - new int[] - { - 4, 5 - }); - log.logFormatted(POILogger.ERROR, - "Test param 1 = %1.1, param 2 = %0.1", new double[] - { - 4, 5.23 - }); + POILogger log = POILogFactory.getLogger( "foo" ); + + log.log( POILogger.WARN, "Test = ", new Integer( 1 ) ); + log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", "2", new Integer( 3 ) ); + log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", new int[]{4, 5} ); + log.logFormatted( POILogger.ERROR, + "Test param 1 = %1.1, param 2 = %0.1", new double[]{4, 5.23} ); } } |