]> source.dussan.org Git - poi.git/commitdiff
Added junit to show bug 45717 is fixed. (Previously fixed by either of r683758, r683871)
authorJosh Micich <josh@apache.org>
Sun, 31 Aug 2008 16:27:35 +0000 (16:27 +0000)
committerJosh Micich <josh@apache.org>
Sun, 31 Aug 2008 16:27:35 +0000 (16:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@690721 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/model/TestSheet.java

index 2479601a39d99af31786c8a390de5c12e30a2c13..ca6a10f45e8ddb9835f8de24b01948e71ce4cb13 100644 (file)
@@ -557,5 +557,23 @@ public final class TestSheet extends TestCase {
         }
         assertEquals("Informations", cell.getRichStringCellValue().getString());
     }
+    /**
+     * In 3.1, setting margins between creating first row and first cell caused an exception.
+     */
+    public void testSetMargins_bug45717() {
+        HSSFWorkbook workbook = new HSSFWorkbook();
+        HSSFSheet sheet = workbook.createSheet("Vorschauliste");
+        HSSFRow row = sheet.createRow(0);
+
+        sheet.setMargin(HSSFSheet.LeftMargin, 0.3);
+        try {
+            row.createCell((short) 0);
+        } catch (IllegalStateException e) {
+            if (e.getMessage().equals("Cannot create value records before row records exist")) {
+                throw new AssertionFailedError("Identified bug 45717");
+            }
+            throw e;
+        }
+    }
 }