testcase for bug 18800
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353424 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2de64d96e5
commit
d988eb7bd2
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user