testcase for bug 18800

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353425 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Avik Sengupta 2003-10-30 17:20:39 +00:00
parent c66f42d340
commit 58623a5194

View File

@ -57,6 +57,8 @@ package org.apache.poi.hssf.usermodel;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.Date;
@ -389,6 +391,22 @@ extends TestCase {
} }
assertTrue("No Exceptions while reading file", true); 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());
}
} }