]> source.dussan.org Git - poi.git/commitdiff
testcase for bug 18800
authorAvik Sengupta <avik@apache.org>
Thu, 30 Oct 2003 17:20:26 +0000 (17:20 +0000)
committerAvik Sengupta <avik@apache.org>
Thu, 30 Oct 2003 17:20:26 +0000 (17:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353424 13f79535-47bb-0310-9956-ffa450edef68

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

index 6485fa01c655fceeac3b751143752ff58bd5c135..b43d5c6c1b92662f9f461b405963ea9a0201ebf8 100644 (file)
@@ -57,6 +57,8 @@ package org.apache.poi.hssf.usermodel;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Date;
 
@@ -389,6 +391,22 @@ extends TestCase {
         }
         assertTrue("No Exceptions while reading file", true);
     }
+    
+     public void test18800() throws Exception {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        HSSFWorkbook book = new HSSFWorkbook();
+        book.createSheet("TEST");
+        HSSFSheet sheet = book.cloneSheet(0);
+        book.setSheetName(1,"CLONE");
+        sheet.createRow(0).createCell((short)0).setCellValue("Test");
+        book.write(out);
+        
+        book = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
+        sheet = book.getSheet("CLONE");
+        HSSFRow row = sheet.getRow(0);
+        HSSFCell cell = row.getCell((short)0);
+        System.out.println(cell.getStringCellValue());
+    }
 }