]> source.dussan.org Git - poi.git/commitdiff
Test for bug #42564 - appears to already be fixed
authorNick Burch <nick@apache.org>
Sun, 10 Feb 2008 21:54:13 +0000 (21:54 +0000)
committerNick Burch <nick@apache.org>
Sun, 10 Feb 2008 21:54:13 +0000 (21:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@620341 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/data/42564.xls [new file with mode: 0644]
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

diff --git a/src/testcases/org/apache/poi/hssf/data/42564.xls b/src/testcases/org/apache/poi/hssf/data/42564.xls
new file mode 100644 (file)
index 0000000..dff150e
Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/42564.xls differ
index 590ec4943c9c0b262d401ef40e15e046296acead..616ec8b1f6231d3b4f5f872839bc0e048c5f76da 100644 (file)
@@ -1010,6 +1010,26 @@ extends TestCase {
         assertTrue("No Exceptions while reading file", true);
     }
 
+    /**
+     * Bug 42564: Some files from Acess were giving a RecordFormatException
+     *  when reading the BOFRecord
+     */
+    public void test42564() throws Exception {
+        FileInputStream in = new FileInputStream(new File(cwd, "42564.xls"));
+        HSSFWorkbook wb = new HSSFWorkbook(in);
+        in.close();
+
+        assertTrue("No Exceptions while reading file", true);
+
+        //serialize and read again
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        wb.write(out);
+        out.close();
+
+        wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
+        assertTrue("No Exceptions while reading file", true);
+    }
+
        /**
         * Bug 42618: RecordFormatException reading a file containing
         *      =CHOOSE(2,A2,A3,A4)