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 7331b7cde2
commit 90bd51d69f
1 changed files with 18 additions and 0 deletions

View 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());
}
}