mirror of https://github.com/apache/poi.git
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:
parent
3ef803b932
commit
614ea00c94
Binary file not shown.
Binary file not shown.
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue