]> source.dussan.org Git - poi.git/commitdiff
Bug 59378: Try to reproduce, but could not
authorDominik Stadler <centic@apache.org>
Thu, 2 Jun 2016 20:09:25 +0000 (20:09 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 2 Jun 2016 20:09:25 +0000 (20:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1746623 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java
test-data/document/59378.docx [new file with mode: 0644]

index 0e7b2c55b21a7c21135d5188e03817e89c9cd34d..28980da9112ca9a61dd4fd9df020b3539363608e 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.poi.xwpf.usermodel;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import org.apache.poi.util.Units;
@@ -153,4 +155,18 @@ public class TestXWPFBugs {
       para.removeRun(para.getRuns().size() -2);
       assertEquals("Some text  some hyper links link linkNew Text", para.getText());
   }
+
+    @Test
+    public void test59378() throws Exception {
+        XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("59378.docx");
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        doc.write(out);
+        out.close();
+
+        XWPFDocument doc2 = new XWPFDocument(new ByteArrayInputStream(out.toByteArray()));
+        doc2.close();
+
+        XWPFDocument docBack = XWPFTestDataSamples.writeOutAndReadBack(doc);
+        docBack.close();
+    }
 }
diff --git a/test-data/document/59378.docx b/test-data/document/59378.docx
new file mode 100644 (file)
index 0000000..f3939ad
Binary files /dev/null and b/test-data/document/59378.docx differ