poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r613400 - in /poi/trunk/src/testcases/org/apache/poi/hssf: data/37684-1.xls data/37684-2.xls usermodel/TestBugs.java
Date Sat, 19 Jan 2008 14:44:07 GMT
Author: yegor
Date: Sat Jan 19 06:44:07 2008
New Revision: 613400

URL: http://svn.apache.org/viewvc?rev=613400&view=rev
Log:
added unit tests for closed Bug 37684: Unhandled Continue Record Error

Added:
    poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-1.xls   (with props)
    poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-2.xls   (with props)
Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Added: poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-1.xls
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-1.xls?rev=613400&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-1.xls
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-1.xls
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-2.xls
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-2.xls?rev=613400&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-2.xls
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/testcases/org/apache/poi/hssf/data/37684-2.xls
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=613400&r1=613399&r2=613400&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Sat Jan 19 06:44:07
2008
@@ -954,6 +954,42 @@
         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);
+    }
 }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message