]> source.dussan.org Git - poi.git/commitdiff
bug 57929: add disabled unit test, adapted from nova
authorJaven O'Neal <onealj@apache.org>
Mon, 20 Jun 2016 07:15:09 +0000 (07:15 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 20 Jun 2016 07:15:09 +0000 (07:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1749270 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java

index 29ac6ab9b41fa5b22bfa9d3fb1b94473f82d5f02..5f99cfb4a37358c6fa3d131872477f4412ef047f 100644 (file)
@@ -1576,4 +1576,34 @@ public abstract class BaseTestBugzillaIssues {
 
         workbook.close();
     }
+    
+    @Ignore
+    @Test
+    public void test57929() throws IOException {
+        // Create a workbook with print areas on 2 sheets
+        Workbook wb = _testDataProvider.createWorkbook();
+        wb.createSheet("Sheet0");
+        wb.createSheet("Sheet1");
+        wb.setPrintArea(0, "$A$1:$C$6");
+        wb.setPrintArea(1, "$B$1:$C$5");
+        
+        // Verify the print areas were set correctly
+        assertEquals("Sheet0!$A$1:$C$6", wb.getPrintArea(0));
+        assertEquals("Sheet1!$B$1:$C$5", wb.getPrintArea(1));
+        
+        // Remove the print area on Sheet0 and change the print area on Sheet1
+        wb.removePrintArea(0);
+        wb.setPrintArea(1, "$A$1:$A$1");
+        
+        // Verify that the changes were made
+        assertNull("Sheet0 before write", wb.getPrintArea(0));
+        assertEquals("Sheet1 before write", "Sheet1!$A$1:$A$1", wb.getPrintArea(1));
+        
+        // Verify that the changes are non-volatile
+        Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb);
+        wb.close();
+        
+        assertNull("Sheet0 after write", wb2.getPrintArea(0)); // CURRENTLY FAILS with "Sheet0!$A$1:$C$6"
+        assertEquals("Sheet1 after write", "Sheet1!$A$1:$A$1", wb2.getPrintArea(1));
+    }
 }