]> source.dussan.org Git - poi.git/commitdiff
Add test case for bug 54399
authorDominik Stadler <centic@apache.org>
Sun, 13 Sep 2015 14:48:58 +0000 (14:48 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 13 Sep 2015 14:48:58 +0000 (14:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1702786 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
test-data/spreadsheet/54399.xlsx [new file with mode: 0644]

index 392ab906efeebc182fe2308fdd15f596a7b84af1..d5070753cdc13daa032a198ee68ffc15d16d6095 100644 (file)
@@ -924,4 +924,20 @@ public final class TestXSSFWorkbook extends BaseTestWorkbook {
             IOUtils.closeQuietly(workbook);
         }
     }
+
+    @Test
+    public void testBug54399() throws IOException {
+        XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("54399.xlsx");
+              
+        //System.out.println("sheets:" + workbook.getNumberOfSheets());
+
+        for (int i = 0; i < workbook.getNumberOfSheets(); i++) {  
+          //System.out.println("i:" + i);
+          workbook.setSheetName(i, "SheetRenamed" + (i + 1));
+        }  
+
+//        FileOutputStream fileOutputStream = new FileOutputStream("/tmp/54399.xlsx"); 
+//        workbook.write(fileOutputStream);
+//        fileOutputStream.close();  
+    }
 }
diff --git a/test-data/spreadsheet/54399.xlsx b/test-data/spreadsheet/54399.xlsx
new file mode 100644 (file)
index 0000000..1aefbac
Binary files /dev/null and b/test-data/spreadsheet/54399.xlsx differ