]> source.dussan.org Git - poi.git/commitdiff
Testcase for HSSFRow removal bug
authorGlen Stampoultzis <glens@apache.org>
Mon, 8 Apr 2002 12:45:57 +0000 (12:45 +0000)
committerGlen Stampoultzis <glens@apache.org>
Mon, 8 Apr 2002 12:45:57 +0000 (12:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352355 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java

index 2ea83fde8469d22ff6c1576cba09be12bf456ba0..fb1b82f0ebd4fd61b9d0dff2f5894e100aa4fd38 100644 (file)
@@ -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());
+
+    }
 }