From 8b0d1f732182525c9c826c7f9cf4208ae65afe25 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Mon, 20 Jun 2016 07:15:09 +0000 Subject: [PATCH] bug 57929: add disabled unit test, adapted from nova git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1749270 13f79535-47bb-0310-9956-ffa450edef68 --- .../ss/usermodel/BaseTestBugzillaIssues.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java index 29ac6ab9b4..5f99cfb4a3 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java @@ -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)); + } } -- 2.39.5