From: Glen Stampoultzis Date: Mon, 8 Apr 2002 12:45:57 +0000 (+0000) Subject: Testcase for HSSFRow removal bug X-Git-Tag: REL_1_5_0~114 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b8457f4fc7aeb6c88cc23f6580da46d4dabd15e3;p=poi.git Testcase for HSSFRow removal bug git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352355 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java index 2ea83fde84..fb1b82f0eb 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java @@ -94,4 +94,21 @@ public class TestHSSFRow assertEquals(2, row.getFirstCellNum()); assertEquals(5, row.getLastCellNum()); } + + public void testRemoveCell() + { + HSSFWorkbook workbook = new HSSFWorkbook(); + HSSFSheet sheet = workbook.createSheet(); + HSSFRow row = sheet.createRow((short) 0); + assertEquals(-1, row.getLastCellNum()); + row.createCell((short)1); + assertEquals(1, row.getLastCellNum()); + row.createCell((short)3); + assertEquals(3, row.getLastCellNum()); + row.removeCell(row.getCell((short)3)); + assertEquals(1, row.getLastCellNum()); + row.removeCell(row.getCell((short)1)); + assertEquals(-1, row.getLastCellNum()); + + } }