]> source.dussan.org Git - poi.git/commitdiff
Integration tests: Add writing out the document
authorDominik Stadler <centic@apache.org>
Sat, 20 Apr 2024 07:53:35 +0000 (07:53 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 20 Apr 2024 07:53:35 +0000 (07:53 +0000)
This will cover some more functionality

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917174 13f79535-47bb-0310-9956-ffa450edef68

poi-integration/src/test/java/org/apache/poi/stress/XWPFFileHandler.java
test-data/spreadsheet/stress.xls

index d588af7df58030ed334936467211bab360ca474e..9b31a61881b3bfa15a94b429384a8db23b9de2ed 100644 (file)
@@ -22,6 +22,7 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.Set;
 
+import org.apache.commons.io.output.NullOutputStream;
 import org.apache.poi.ooxml.POIXMLException;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.junit.jupiter.api.Test;
@@ -41,6 +42,8 @@ public class XWPFFileHandler extends AbstractFileHandler {
         try (XWPFDocument doc = new XWPFDocument(stream)) {
             new POIXMLDocumentHandler().handlePOIXMLDocument(doc);
             POIXMLDocumentHandler.cursorRecursive(doc.getDocument());
+
+            doc.write(NullOutputStream.INSTANCE);
         } catch (POIXMLException e) {
             Exception cause = (Exception)e.getCause();
             throw cause == null ? e : cause;
index 0c9f7271897f76f3fa7dc9d65ec477544d0af359..e784502ec932a9382521f6d5b521e6f8dc2cf333 100644 (file)
Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ