Testcase for 24215. sync from branch

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353423 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Avik Sengupta 2003-10-30 16:46:43 +00:00
parent 003c0e8b30
commit c66f42d340
2 changed files with 235 additions and 216 deletions

Binary file not shown.

View File

@ -79,8 +79,7 @@ extends TestCase {
/** Test reading AND writing a complicated workbook
*Test opening resulting sheet in excel*/
public void test15228()
throws java.io.IOException
{
throws java.io.IOException {
String readFilename = System.getProperty("HSSF.testdata.path");
FileInputStream in = new FileInputStream(readFilename+File.separator+"15228.xls");
HSSFWorkbook wb = new HSSFWorkbook(in);
@ -97,8 +96,7 @@ extends TestCase {
}
public void test13796()
throws java.io.IOException
{
throws java.io.IOException {
String readFilename = System.getProperty("HSSF.testdata.path");
FileInputStream in = new FileInputStream(readFilename+File.separator+"13796.xls");
HSSFWorkbook wb = new HSSFWorkbook(in);
@ -363,13 +361,34 @@ extends TestCase {
/** Illegal argument exception - cannot store duplicate value in Map*/
public void test19599() throws java.io.IOException {
FileInputStream in = new FileInputStream("19599-1.xls");
String filename = System.getProperty("HSSF.testdata.path");
FileInputStream in = new FileInputStream(filename+"/19599-1.xls");
HSSFWorkbook wb = new HSSFWorkbook(in);
in = new FileInputStream("19599-2.xls");
in = new FileInputStream(filename+"/19599-2.xls");
wb = new HSSFWorkbook(in);
this.assertTrue("Read workbook, No exceptions" , true);
}
public void test24215() throws Exception {
String filename = System.getProperty("HSSF.testdata.path");
HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(filename+"/24215.xls"));
for (int sheetIndex = 0; sheetIndex < wb.getNumberOfSheets();sheetIndex++) {
HSSFSheet sheet = wb.getSheetAt(sheetIndex);
int rows = sheet.getLastRowNum();
for (int rowIndex = 0; rowIndex < rows; rowIndex++) {
HSSFRow row = sheet.getRow(rowIndex);
int cells = row.getLastCellNum();
for (short cellIndex = 0; cellIndex < cells; cellIndex++) {
HSSFCell cell = row.getCell(cellIndex);
}
}
}
assertTrue("No Exceptions while reading file", true);
}
}