Skip to content

Commit

Permalink
Integration tests: Add writing out the document
Browse files Browse the repository at this point in the history
This will cover some more functionality

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917174 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
centic9 committed Apr 20, 2024
1 parent d87ffbc commit 8c10198
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Expand Up @@ -22,6 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
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;
Expand All @@ -41,6 +42,8 @@ public void handleFile(InputStream stream, String path) throws Exception {
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;
Expand Down
Binary file modified test-data/spreadsheet/stress.xls
Binary file not shown.

0 comments on commit 8c10198

Please sign in to comment.