poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r1139518 - in /poi/trunk: ./ src/java/org/apache/poi/hssf/record/common/ src/java/org/apache/poi/hssf/usermodel/ src/java/org/apache/poi/poifs/storage/ src/java/org/apache/poi/ss/usermodel/ src/ooxml/java/org/apache/poi/openxml4j/opc/ src/o...
Date Sat, 25 Jun 2011 10:56:47 GMT
Author: yegor
Date: Sat Jun 25 10:56:46 2011
New Revision: 1139518

URL: http://svn.apache.org/viewvc?rev=1139518&view=rev
Log:
cleanup sxxsf temp files after tests, remove non-ascii characters from source code, polished
test output

Modified:
    poi/trunk/build.xml
    poi/trunk/src/java/org/apache/poi/hssf/record/common/UnicodeString.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
    poi/trunk/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/extractor/TestVisioExtractor.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java
    poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java

Modified: poi/trunk/build.xml
URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/build.xml (original)
+++ poi/trunk/build.xml Sat Jun 25 10:56:46 2011
@@ -66,6 +66,12 @@ under the License.
     <property name="jdk.version.class" value="1.5" description="JDK version of generated
class files"/>
     <property name="compile.debug" value="true"/>
 
+    <!-- 
+        Logging is suppressed by default. 
+        To redirect log output to console, run ant with -Dorg.apache.poi.util.POILogger=org.apache.poi.util.SystemOutLogger
 
+    -->
+    <property name="org.apache.poi.util.POILogger" value="org.apache.poi.util.NullLogger"/>
+
     <!-- issue warnings if source code contains unmappable characters for encoding ASCII
 -->
     <property name="java.source.encoding" value="ASCII"/>
 
@@ -165,6 +171,7 @@ under the License.
     <propertyset id="junit.properties">
         <propertyref name="POI.testdata.path"/>
         <propertyref name="java.awt.headless"/>
+        <propertyref name="org.apache.poi.util.POILogger"/>
     </propertyset>
 
     <path id="main.classpath">

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/common/UnicodeString.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/common/UnicodeString.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/common/UnicodeString.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/common/UnicodeString.java Sat Jun 25 10:56:46
2011
@@ -25,11 +25,8 @@ import java.util.List;
 import org.apache.poi.hssf.record.cont.ContinuableRecordInput;
 import org.apache.poi.hssf.record.RecordInputStream;
 import org.apache.poi.hssf.record.cont.ContinuableRecordOutput;
-import org.apache.poi.util.BitField;
-import org.apache.poi.util.BitFieldFactory;
-import org.apache.poi.util.LittleEndianInput;
-import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.StringUtil;
+import org.apache.poi.poifs.dev.POIFSLister;
+import org.apache.poi.util.*;
 
 /**
  * Title: Unicode String<p/>
@@ -40,6 +37,8 @@ import org.apache.poi.util.StringUtil;
  * REFERENCE:  PG 951 Excel Binary File Format (.xls) Structure Specification v20091214 
  */
 public class UnicodeString implements Comparable<UnicodeString> { // TODO - make this
final when the compatibility version is removed
+    private static POILogger _logger = POILogFactory.getLogger(UnicodeString.class);
+
     private short             field_1_charCount;
     private byte              field_2_optionflags;
     private String            field_3_string;
@@ -138,7 +137,7 @@ public class UnicodeString implements Co
           
           // Spot corrupt records
           if(reserved != 1) {
-             System.err.println("Warning - ExtRst was has wrong magic marker, expecting 1
but found " + reserved + " - ignoring");
+             _logger.log(POILogger.WARN, "Warning - ExtRst has wrong magic marker, expecting
1 but found " + reserved + " - ignoring");
              // Grab all the remaining data, and ignore it
              for(int i=0; i<expectedLength-2; i++) {
                 in.readByte();
@@ -438,7 +437,7 @@ public class UnicodeString implements Co
         if (isExtendedText() && (extensionLength > 0)) {
           field_5_ext_rst = new ExtRst(new ContinuableRecordInput(in), extensionLength);
           if(field_5_ext_rst.getDataSize()+4 != extensionLength) {
-             System.err.println("ExtRst was supposed to be " + extensionLength + " bytes
long, but seems to actually be " + (field_5_ext_rst.getDataSize()+4));
+             _logger.log(POILogger.WARN, "ExtRst was supposed to be " + extensionLength +
" bytes long, but seems to actually be " + (field_5_ext_rst.getDataSize() + 4));
           }
         }
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java Sat Jun 25 10:56:46 2011
@@ -438,7 +438,7 @@ public final class HSSFSheet implements 
      *
      * <p>
      * Character width is defined as the maximum digit width
-     * of the numbers <code>0, 1, 2, … 9</code> as rendered
+     * of the numbers <code>0, 1, 2, ... 9</code> as rendered
      * using the default font (first font in the workbook).
      * <br/>
      * Unless you are using a very special font, the default character is '0' (zero),

Modified: poi/trunk/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java Sat Jun
25 10:56:46 2011
@@ -23,9 +23,7 @@ import java.util.*;
 
 import org.apache.poi.poifs.common.POIFSBigBlockSize;
 import org.apache.poi.poifs.common.POIFSConstants;
-import org.apache.poi.util.IntList;
-import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.LittleEndianConsts;
+import org.apache.poi.util.*;
 
 /**
  * This class manages and creates the Block Allocation Table, which is
@@ -43,7 +41,8 @@ import org.apache.poi.util.LittleEndianC
  * @author Marc Johnson (mjohnson at apache dot org)
  */
 public final class BlockAllocationTableReader {
-    
+    private static final POILogger _logger = POILogFactory.getLogger(BlockAllocationTableReader.class);
+
     /**
      * Maximum number size (in blocks) of the allocation table as supported by
      * POI.<br/>
@@ -227,12 +226,12 @@ public final class BlockAllocationTableR
             } catch(IOException e) {
                 if(currentBlock == headerPropertiesStartBlock) {
                     // Special case where things are in the wrong order
-                    System.err.println("Warning, header block comes after data blocks in
POIFS block listing");
+                    _logger.log(POILogger.WARN, "Warning, header block comes after data blocks
in POIFS block listing");
                     currentBlock = POIFSConstants.END_OF_CHAIN;
                 } else if(currentBlock == 0 && firstPass) {
                     // Special case where the termination isn't done right
                     //  on an empty set
-                    System.err.println("Warning, incorrectly terminated empty data blocks
in POIFS block listing (should end at -2, ended at 0)");
+                    _logger.log(POILogger.WARN, "Warning, incorrectly terminated empty data
blocks in POIFS block listing (should end at -2, ended at 0)");
                     currentBlock = POIFSConstants.END_OF_CHAIN;
                 } else {
                     // Ripple up

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java Sat Jun 25 10:56:46 2011
@@ -127,7 +127,7 @@ public interface Sheet extends Iterable<
      *
      * <p>
      * Character width is defined as the maximum digit width
-     * of the numbers <code>0, 1, 2, … 9</code> as rendered
+     * of the numbers <code>0, 1, 2, ... 9</code> as rendered
      * using the default font (first font in the workbook).
      * <br/>
      * Unless you are using a very special font, the default character is '0' (zero),
@@ -167,7 +167,7 @@ public interface Sheet extends Iterable<
      *
      * <p>
      * Character width is defined as the maximum digit width
-     * of the numbers <code>0, 1, 2, … 9</code> as rendered
+     * of the numbers <code>0, 1, 2, ... 9</code> as rendered
      * using the default font (first font in the workbook)
      * </p>
      *

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java Sat Jun
25 10:56:46 2011
@@ -24,6 +24,8 @@ import java.io.UnsupportedEncodingExcept
 
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 /**
  * Helper for part and pack URI.
@@ -32,6 +34,7 @@ import org.apache.poi.openxml4j.exceptio
  * @version 0.1
  */
 public final class PackagingURIHelper {
+    private final static POILogger _logger = POILogFactory.getLogger(PackagingURIHelper.class);
 
 	/**
 	 * Package root URI.
@@ -293,7 +296,7 @@ public final class PackagingURIHelper {
                 try {
                     targetURI = new URI(path.substring(1));
                 } catch (Exception e) {
-                    System.err.println(e);
+                    _logger.log(POILogger.WARN, e);
                     return null;
                 }
             }
@@ -331,7 +334,7 @@ public final class PackagingURIHelper {
 			try {
 				return new URI(retVal.toString());
 			} catch (Exception e) {
-				System.err.println(e);
+				_logger.log(POILogger.WARN, e);
 				return null;
 			}
 		}
@@ -373,7 +376,7 @@ public final class PackagingURIHelper {
 		try {
 			return new URI(retVal.toString());
 		} catch (Exception e) {
-			System.err.println(e);
+			_logger.log(POILogger.WARN, e);
 			return null;
 		}
 	}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java Sat Jun 25 10:56:46
2011
@@ -1261,7 +1261,7 @@ public class SXSSFSheet implements Sheet
 
         public SheetDataWriter() throws IOException 
         {
-            _fd = File.createTempFile("sheet", ".xml");
+            _fd = File.createTempFile("poi-sxxsf-sheet", ".xml");
             _fd.deleteOnExit();
             _out = new BufferedWriter(new FileWriter(_fd));
             _out.write("<sheetData>\n");

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java Sat Jun 25 10:56:46
2011
@@ -533,7 +533,8 @@ public class SXSSFWorkbook implements Wo
     public void write(OutputStream stream) throws IOException
     {
         //Save the template
-        File tmplFile = File.createTempFile("template", ".xlsx");
+        File tmplFile = File.createTempFile("poi-sxxsf-template", ".xlsx");
+        tmplFile.deleteOnExit();
         FileOutputStream os = new FileOutputStream(tmplFile);
         _wb.write(os);
         os.close();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Sat Jun 25 10:56:46
2011
@@ -1935,7 +1935,7 @@ public class XSSFSheet extends POIXMLDoc
      *
      * <p>
      * Character width is defined as the maximum digit width
-     * of the numbers <code>0, 1, 2, … 9</code> as rendered
+     * of the numbers <code>0, 1, 2, ... 9</code> as rendered
      * using the default font (first font in the workbook).
      * <br/>
      * Unless you are using a very special font, the default character is '0' (zero),

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/TestPOIXMLDocument.java Sat Jun 25 10:56:46
2011
@@ -148,7 +148,7 @@ public final class TestPOIXMLDocument ex
         doc.parse(new TestFactory());
 
         for(POIXMLDocumentPart rel : doc.getRelations()){
-            System.out.println(rel);
+            //TODO finish me
         }
 
     }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java Sat Jun 25 10:56:46
2011
@@ -21,6 +21,8 @@ import java.io.IOException;
 import org.apache.poi.hwpf.model.io.HWPFFileSystem;
 import org.apache.poi.hwpf.model.io.HWPFOutputStream;
 import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 /**
  * FontTable or in MS terminology sttbfffn is a common data structure written in all
@@ -32,6 +34,7 @@ import org.apache.poi.util.LittleEndian;
  */
 public final class FontTable
 {
+  private final static POILogger _logger = POILogFactory.getLogger(FontTable.class);
   private short _stringCount;// how many strings are included in the string table
   private short _extraDataSz;// size in bytes of the extra data
 
@@ -86,7 +89,7 @@ public final class FontTable
   {
     if(chpFtc >= _stringCount)
     {
-      System.out.println("Mismatch in chpFtc with stringCount");
+      _logger.log(POILogger.INFO, "Mismatch in chpFtc with stringCount");
       return null;
     }
 
@@ -97,7 +100,7 @@ public final class FontTable
   {
     if(chpFtc >= _stringCount)
     {
-      System.out.println("Mismatch in chpFtc with stringCount");
+      _logger.log(POILogger.INFO, "Mismatch in chpFtc with stringCount");
       return null;
     }
 

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java Sat Jun 25 10:56:46
2011
@@ -17,6 +17,9 @@
 
 package org.apache.poi.hwpf.model;
 
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
+
 import java.util.Arrays;
 
 /**
@@ -30,6 +33,7 @@ import java.util.Arrays;
  */
 public abstract class PropertyNode implements Comparable, Cloneable
 {
+  private final static POILogger _logger = POILogFactory.getLogger(PropertyNode.class);
   protected Object _buf;
   /** The start, in characters */
   private int _cpStart;
@@ -49,7 +53,7 @@ public abstract class PropertyNode imple
       _buf = buf;
 
       if(_cpStart < 0) {
-    	  System.err.println("A property claimed to start before zero, at " + _cpStart + "!
Resetting it to zero, and hoping for the best");
+    	  _logger.log(POILogger.WARN, "A property claimed to start before zero, at " + _cpStart
+ "! Resetting it to zero, and hoping for the best");
     	  _cpStart = 0;
       }
   }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java Sat Jun 25 10:56:46
2011
@@ -23,12 +23,15 @@ import java.util.List;
 
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.hwpf.model.io.*;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 /**
  * @author Ryan Ackley
  */
 public class SectionTable
 {
+  private final static POILogger _logger = POILogFactory.getLogger(SectionTable.class);
   private static final int SED_SIZE = 12;
 
   protected ArrayList<SEPX> _sections = new ArrayList<SEPX>();
@@ -92,7 +95,7 @@ public class SectionTable
     	}
     }
     if(! matchAt && matchHalf) {
-    	System.err.println("Your document seemed to be mostly unicode, but the section definition
was in bytes! Trying anyway, but things may well go wrong!");
+    	_logger.log(POILogger.WARN, "Your document seemed to be mostly unicode, but the section
definition was in bytes! Trying anyway, but things may well go wrong!");
         for(int i=0; i<_sections.size(); i++) {
         	SEPX s = _sections.get(i);
             GenericPropertyNode node = sedPlex.getProperty(i);

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/extractor/TestVisioExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/extractor/TestVisioExtractor.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/extractor/TestVisioExtractor.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/extractor/TestVisioExtractor.java
Sat Jun 25 10:56:46 2011
@@ -115,10 +115,12 @@ public final class TestVisioExtractor ex
 		// Check
 		capture.flush();
 		String text = baos.toString();
-		assertEquals(
+        // YK: stdout can contain lots of other stuff if logging is sent to console
+        // ( -Dorg.apache.poi.util.POILogger=org.apache.poi.util.SystemOutLogger)
+		assertTrue( text.contains(
 		      "text\nView\n" +
 		      "Test View\nI am a test view\n" +
-		      "Some random text, on a page\n", 
-		      text);
+		      "Some random text, on a page\n"
+		      ));
 	}
 }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormat.java Sat Jun
25 10:56:46 2011
@@ -21,11 +21,14 @@ import org.apache.poi.hssf.HSSFITestData
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 /**
  * Tests for {@link HSSFDataFormat}
  */
 public final class TestHSSFDataFormat extends BaseTestDataFormat {
+    private static POILogger _logger = POILogFactory.getLogger(TestHSSFDataFormat.class);
 
     public TestHSSFDataFormat() {
         super(HSSFITestDataProvider.instance);
@@ -61,8 +64,9 @@ public final class TestHSSFDataFormat ex
                     CellStyle style = cell.getCellStyle();
 
                     String fmt = style.getDataFormatString();
-                    if(fmt == null)
-                        System.out.println(cell + ": " + fmt);
+                    if(fmt == null) {
+                        _logger.log(POILogger.WARN, cell + ": " + fmt);
+                    }
                 }
             }
         }

Modified: poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java?rev=1139518&r1=1139517&r2=1139518&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestEmptyDocument.java Sat Jun
25 10:56:46 2011
@@ -29,8 +29,11 @@ import org.apache.poi.poifs.filesystem.P
 import org.apache.poi.poifs.filesystem.POIFSWriterEvent;
 import org.apache.poi.poifs.filesystem.POIFSWriterListener;
 import org.apache.poi.poifs.filesystem.DirectoryEntry;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 public final class TestEmptyDocument extends TestCase {
+    private static POILogger _logger = POILogFactory.getLogger(TestEmptyDocument.class);
 
 	public void testSingleEmptyDocument() throws IOException {
 		POIFSFileSystem fs = new POIFSFileSystem();
@@ -47,7 +50,7 @@ public final class TestEmptyDocument ext
 		DirectoryEntry dir = fs.getRoot();
 		dir.createDocument("Foo", 0, new POIFSWriterListener() {
 			public void processPOIFSWriterEvent(POIFSWriterEvent event) {
-				System.out.println("written");
+				_logger.log(POILogger.WARN, "written");
 			}
 		});
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message