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)
+ */
+ public void test42618() throws Exception {
+ FileInputStream in = new FileInputStream(new File(cwd, "SimpleWithChoose.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);
+ }
}