]> source.dussan.org Git - poi.git/commitdiff
More coverage of class EscherDump
authorDominik Stadler <centic@apache.org>
Thu, 16 Jul 2015 03:42:17 +0000 (03:42 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 16 Jul 2015 03:42:17 +0000 (03:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1691311 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/ddf/TestEscherDump.java

index 5d05bb2f0ed2d4c8aa3135c4ac23ff96a9c1c242..276c15f414a1e361d5e546c47f509d8b9c74fa2b 100644 (file)
 
 package org.apache.poi.ddf;
 
+import static org.junit.Assert.*;
+
 import java.io.ByteArrayInputStream;
 
+import org.apache.poi.POIDataSamples;
+import org.apache.poi.hssf.HSSFTestDataSamples;
+import org.apache.poi.util.IOUtils;
 import org.junit.Test;
 
 public class TestEscherDump {
@@ -36,4 +41,18 @@ public class TestEscherDump {
     public void testWithData() throws Exception {
         new EscherDump().dumpOld(8, new ByteArrayInputStream(new byte[] { 00, 00, 00, 00, 00, 00, 00, 00 }), System.out);
     }
+
+    @Test
+    public  void testWithSamplefile() throws Exception {
+        //InputStream stream = HSSFTestDataSamples.openSampleFileStream(")
+        byte[] data = POIDataSamples.getDDFInstance().readFile("Container.dat");
+        new EscherDump().dump(data.length, data, System.out);
+        //new EscherDump().dumpOld(data.length, new ByteArrayInputStream(data), System.out);
+        
+        data = new byte[2586114];
+        int bytes = IOUtils.readFully(HSSFTestDataSamples.openSampleFileStream("44593.xls"), data);
+        assertTrue(bytes != -1);
+        //new EscherDump().dump(bytes, data, System.out);
+        //new EscherDump().dumpOld(bytes, new ByteArrayInputStream(data), System.out);
+    }
 }