add failing unit test for bug 55076: collapsing column groups only hides the first column

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761846 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-09-22 04:24:22 +00:00
parent e9a16f2c5e
commit 257e6197ca

View File

@ -3091,4 +3091,35 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
assertEquals("09 Mar 2016", result); assertEquals("09 Mar 2016", result);
} }
// This bug is currently open. When this bug is fixed, it should not throw an AssertionError
@Test(expected=AssertionError.class)
public void test55076_collapseColumnGroups() throws Exception {
Workbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
// this column collapsing bug only occurs when the grouped columns are different widths
sheet.setColumnWidth(1, 400);
sheet.setColumnWidth(2, 600);
sheet.setColumnWidth(3, 800);
assertEquals(400, sheet.getColumnWidth(1));
assertEquals(600, sheet.getColumnWidth(2));
assertEquals(800, sheet.getColumnWidth(3));
sheet.groupColumn(1, 3);
sheet.setColumnGroupCollapsed(1, true);
assertEquals(400, sheet.getColumnWidth(1));
assertEquals(600, sheet.getColumnWidth(2));
assertEquals(800, sheet.getColumnWidth(3));
// none of the columns should be hidden
// column group collapsing is a different concept
for (int c=0; c<5; c++) {
assertFalse("Column " + c, sheet.isColumnHidden(c));
}
wb.close();
}
} }