poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1720534 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Date Thu, 17 Dec 2015 12:39:01 GMT
Author: centic
Date: Thu Dec 17 12:39:01 2015
New Revision: 1720534

URL: http://svn.apache.org/viewvc?rev=1720534&view=rev
Log:
Fix unit test for bug 58731 to actually run

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=1720534&r1=1720533&r2=1720534&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 Dec
17 12:39:01 2015
@@ -2851,6 +2851,7 @@ public final class TestXSSFBugs extends
         wbBack.close();
     }
     
+    @Test
     public void test58731() throws Exception {
         Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58731.xlsx");
         Sheet sheet = wb.createSheet("Java Books");
@@ -2864,11 +2865,11 @@ public final class TestXSSFBugs extends
  
         int rowCount = 0;
         for (Object[] aBook : bookData) {
-            Row row = sheet.createRow(++rowCount);
+            Row row = sheet.createRow(rowCount++);
              
             int columnCount = 0;
             for (Object field : aBook) {
-                Cell cell = row.createCell(++columnCount);
+                Cell cell = row.createCell(columnCount++);
                 if (field instanceof String) {
                     cell.setCellValue((String) field);
                 } else if (field instanceof Integer) {
@@ -2878,7 +2879,9 @@ public final class TestXSSFBugs extends
         }
         
         Workbook wb2 = XSSFTestDataSamples.writeOutAndReadBack(wb);
-        sheet = wb.getSheet("Java Books");
+        sheet = wb2.getSheet("Java Books");
+        assertNotNull(sheet.getRow(0));
+        assertNotNull(sheet.getRow(0).getCell(0));
         assertEquals(bookData[0][0], sheet.getRow(0).getCell(0).getStringCellValue());
     }
 }



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


Mime
View raw message