import static org.junit.Assert.assertTrue;\r
\r
import java.io.File;\r
+import java.io.IOException;\r
import java.io.InputStream;\r
+import java.util.zip.ZipEntry;\r
+import java.util.zip.ZipFile;\r
\r
import javax.crypto.Cipher;\r
\r
import org.apache.poi.POIDataSamples;\r
+import org.apache.poi.openxml4j.OpenXML4JTestDataSamples;\r
import org.apache.poi.openxml4j.opc.OPCPackage;\r
import org.apache.poi.poifs.crypt.CipherAlgorithm;\r
import org.apache.poi.poifs.crypt.Decryptor;\r
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;\r
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;\r
import org.apache.poi.xwpf.usermodel.XWPFDocument;\r
+import org.apache.xmlbeans.XmlException;\r
import org.junit.Assume;\r
import org.junit.Test;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument;\r
\r
public class TestXWPFBugs {\r
/**\r
\r
filesystem.close();\r
}\r
-}\r
+\r
+ \r
+ @Test\r
+ public void bug59058() throws IOException, XmlException {\r
+ String files[] = { "bug57031.docx", "bug59058.docx" };\r
+ for (String f : files) {\r
+ ZipFile zf = new ZipFile(POIDataSamples.getDocumentInstance().getFile(f));\r
+ ZipEntry entry = zf.getEntry("word/document.xml");\r
+ DocumentDocument document = DocumentDocument.Factory.parse(zf.getInputStream(entry));\r
+ assertNotNull(document);\r
+ zf.close();\r
+ }\r
+ }\r
+}
\ No newline at end of file