poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1701132 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java test-data/spreadsheet/51626.xlsx test-data/spreadsheet/51626_contact.xlsx
Date Thu, 03 Sep 2015 20:46:05 GMT
Author: centic
Date: Thu Sep  3 20:46:04 2015
New Revision: 1701132

URL: http://svn.apache.org/r1701132
Log:
Add unit tests to verify that bug 51626 and bug 51451 are fixed

Conflicts:
	src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

Added:
    poi/trunk/test-data/spreadsheet/51626.xlsx
    poi/trunk/test-data/spreadsheet/51626_contact.xlsx
Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1701132&r1=1701131&r2=1701132&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Thu Sep
 3 20:46:04 2015
@@ -29,9 +29,10 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.List;
@@ -66,6 +67,7 @@ import org.apache.poi.ss.usermodel.CellV
 import org.apache.poi.ss.usermodel.ClientAnchor;
 import org.apache.poi.ss.usermodel.Comment;
 import org.apache.poi.ss.usermodel.CreationHelper;
+import org.apache.poi.ss.usermodel.DataFormat;
 import org.apache.poi.ss.usermodel.DataFormatter;
 import org.apache.poi.ss.usermodel.DateUtil;
 import org.apache.poi.ss.usermodel.Drawing;
@@ -2571,4 +2573,47 @@ public final class TestXSSFBugs extends
             }
         }
     }
+
+    @Test
+    public void test51626() throws Exception {
+        Workbook wb = XSSFTestDataSamples.openSampleWorkbook("51626.xlsx");
+        assertNotNull(wb);
+        wb.close();
+        
+        InputStream stream = HSSFTestDataSamples.openSampleFileStream("51626.xlsx");
+        wb = WorkbookFactory.create(stream);
+        stream.close();
+        wb.close();
+        
+        wb = XSSFTestDataSamples.openSampleWorkbook("51626_contact.xlsx");
+        assertNotNull(wb);
+        wb.close();
+        
+        stream = HSSFTestDataSamples.openSampleFileStream("51626_contact.xlsx");
+        wb = WorkbookFactory.create(stream);
+        stream.close();
+        wb.close();
+    }
+    
+    @Test
+    public void test51451() throws IOException {
+        Workbook wb = new XSSFWorkbook();
+        Sheet sh = wb.createSheet();
+        
+        Row row = sh.createRow(0);
+        Cell cell = row.createCell(0);
+        cell.setCellValue(239827342);
+        
+        CellStyle style = wb.createCellStyle();
+        //style.setHidden(false);
+        DataFormat excelFormat = wb.createDataFormat();
+        style.setDataFormat(excelFormat.getFormat("#,##0"));
+        sh.setDefaultColumnStyle(0, style);
+
+//        FileOutputStream out = new FileOutputStream("/tmp/51451.xlsx");
+//        wb.write(out);
+//        out.close();
+        
+        wb.close();
+    }
 }

Added: poi/trunk/test-data/spreadsheet/51626.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/51626.xlsx?rev=1701132&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/51626.xlsx (added) and poi/trunk/test-data/spreadsheet/51626.xlsx
Thu Sep  3 20:46:04 2015 differ

Added: poi/trunk/test-data/spreadsheet/51626_contact.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/51626_contact.xlsx?rev=1701132&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/51626_contact.xlsx (added) and poi/trunk/test-data/spreadsheet/51626_contact.xlsx
Thu Sep  3 20:46:04 2015 differ



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


Mime
View raw message