poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1808505 - /poi/trunk/src/integrationtest/org/apache/poi/stress/XWPFFileHandler.java
Date Sat, 16 Sep 2017 08:20:44 GMT
Author: centic
Date: Sat Sep 16 08:20:44 2017
New Revision: 1808505

URL: http://svn.apache.org/viewvc?rev=1808505&view=rev
Log:
Adjust local test in integration-test file-handler

Modified:
    poi/trunk/src/integrationtest/org/apache/poi/stress/XWPFFileHandler.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/XWPFFileHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/XWPFFileHandler.java?rev=1808505&r1=1808504&r2=1808505&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/XWPFFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/XWPFFileHandler.java Sat Sep 16 08:20:44
2017
@@ -16,38 +16,37 @@
 ==================================================================== */
 package org.apache.poi.stress;
 
+import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
-import java.io.PushbackInputStream;
 
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.junit.Test;
 
 public class XWPFFileHandler extends AbstractFileHandler {
-	@Override
+    @Override
     public void handleFile(InputStream stream, String path) throws Exception {
         // ignore password protected files
         if (POIXMLDocumentHandler.isEncrypted(stream)) return;
 
         XWPFDocument doc = new XWPFDocument(stream);
-		
-		new POIXMLDocumentHandler().handlePOIXMLDocument(doc);
-	}
-
-	// a test-case to test this locally without executing the full TestAllFiles
-	@Test
-	public void test() throws Exception {
+        
+        new POIXMLDocumentHandler().handlePOIXMLDocument(doc);
+    }
+
+    // a test-case to test this locally without executing the full TestAllFiles
+    @Test
+    public void test() throws Exception {
         File file = new File("test-data/document/51921-Word-Crash067.docx");
 
-        InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000);
-		try {
-			handleFile(stream, file.getPath());
-		} finally {
-			stream.close();
-		}
-		
-		handleExtracting(file);
-	}
-	
+        InputStream stream = new BufferedInputStream(new FileInputStream(file));
+        try {
+            handleFile(stream, file.getPath());
+        } finally {
+            stream.close();
+        }
+
+        handleExtracting(file);
+    }
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message