added unit tests for closed Bug 37684: Unhandled Continue Record Error

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@613400 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2008-01-19 14:44:07 +00:00
parent f6cd038ce3
commit 2c46d2a3f7
3 changed files with 36 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -954,6 +954,42 @@ extends TestCase {
assertTrue("No Exceptions while reading file", true);
}
/**
* Bug 37684 : Unhandled Continue Record Error
*/
public void test37684 () throws Exception {
FileInputStream in = new FileInputStream(new File(cwd, "37684-1.xls"));
HSSFWorkbook wb = new HSSFWorkbook(in);
in.close();
assertTrue("No exceptions while reading workbook", true);
//serialize and read again
ByteArrayOutputStream out = new ByteArrayOutputStream();
wb.write(out);
out.close();
assertTrue("No exceptions while saving workbook", true);
wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
assertTrue("No exceptions while reading saved stream", true);
in = new FileInputStream(new File(cwd, "37684-2.xls"));
wb = new HSSFWorkbook(in);
in.close();
assertTrue("No exceptions while reading workbook", true);
//serialize and read again
out = new ByteArrayOutputStream();
wb.write(out);
out.close();
assertTrue("No exceptions while saving workbook", true);
wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
assertTrue("No exceptions while reading saved stream", true);
}
}