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
f6cd038ce3
commit
2c46d2a3f7
BIN
src/testcases/org/apache/poi/hssf/data/37684-1.xls
Executable file
BIN
src/testcases/org/apache/poi/hssf/data/37684-1.xls
Executable file
Binary file not shown.
BIN
src/testcases/org/apache/poi/hssf/data/37684-2.xls
Executable file
BIN
src/testcases/org/apache/poi/hssf/data/37684-2.xls
Executable file
Binary file not shown.
@ -954,6 +954,42 @@ extends TestCase {
|
|||||||
assertTrue("No Exceptions while reading file", true);
|
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
Block a user