aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/eventusermodel
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2007-09-13 19:11:10 +0000
committerYegor Kozlov <yegor@apache.org>2007-09-13 19:11:10 +0000
commit0b8319bdcdcefea87e0cad3e1165c277f09e9a7a (patch)
tree409dec8e440ea3aa022f5491d214a0f6e68bf6a5 /src/testcases/org/apache/poi/hssf/eventusermodel
parent5e35e578b0be54430da70833e89d5bc508496bfe (diff)
downloadpoi-0b8319bdcdcefea87e0cad3e1165c277f09e9a7a.tar.gz
poi-0b8319bdcdcefea87e0cad3e1165c277f09e9a7a.zip
fixed re-open of bug #42844. HSSFEventFactory silently skips unknown records that happen to be continued.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@575406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/eventusermodel')
-rw-r--r--src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java
index 055629fa48..bd936a0afc 100644
--- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java
+++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestHSSFEventFactory.java
@@ -76,6 +76,24 @@ public class TestHSSFEventFactory extends TestCase {
}
}
+ /**
+ * Unknown records can be continued.
+ * Check that HSSFEventFactory doesn't break on them.
+ * (the test file was provided in a reopen of bug #42844)
+ */
+ public void testUnknownContinueRecords() throws Exception {
+ File f = new File(dirname + "/42844.xls");
+
+ HSSFRequest req = new HSSFRequest();
+ MockHSSFListener mockListen = new MockHSSFListener();
+ req.addListenerForAllRecords(mockListen);
+
+ POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(f));
+ HSSFEventFactory factory = new HSSFEventFactory();
+ factory.processWorkbookEvents(req, fs);
+
+ assertTrue("no errors while processing the file", true);
+ }
private static class MockHSSFListener implements HSSFListener {
private MockHSSFListener() {}