You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2015/12/31 09:23:04 UTC
svn commit: r1722425 -
/poi/trunk/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
Author: centic
Date: Thu Dec 31 08:23:04 2015
New Revision: 1722425
URL: http://svn.apache.org/viewvc?rev=1722425&view=rev
Log:
Revert changes to integration-test-framework to not make tests fail with strange errors about entity expansion limits
Modified:
poi/trunk/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java?rev=1722425&r1=1722424&r2=1722425&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java Thu Dec 31 08:23:04 2015
@@ -47,19 +47,13 @@ public class XSSFFileHandler extends Spr
// ignore password protected files
if (POIXMLDocumentHandler.isEncrypted(stream)) return;
- final XSSFWorkbook wb;
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ IOUtils.copy(stream, out);
- // make sure the potentially large byte-array is freed up quickly again
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- IOUtils.copy(stream, out);
- final byte[] bytes = out.toByteArray();
-
- checkXSSFReader(OPCPackage.open(new ByteArrayInputStream(bytes)));
+ final byte[] bytes = out.toByteArray();
+ final XSSFWorkbook wb;
+ wb = new XSSFWorkbook(new ByteArrayInputStream(bytes));
- wb = new XSSFWorkbook(new ByteArrayInputStream(bytes));
- }
-
// use the combined handler for HSSF/XSSF
handleWorkbook(wb, ".xlsx");
@@ -72,6 +66,8 @@ public class XSSFFileHandler extends Spr
// and finally ensure that exporting to XML works
exportToXML(wb);
+
+ checkXSSFReader(OPCPackage.open(new ByteArrayInputStream(bytes)));
}
@@ -119,7 +115,7 @@ public class XSSFFileHandler extends Spr
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
- InputStream stream = new BufferedInputStream(new FileInputStream("test-data/openxml4j/50154.xlsx"));
+ InputStream stream = new BufferedInputStream(new FileInputStream("test-data/spreadsheet/ref-56737.xlsx"));
try {
handleFile(stream);
} finally {
@@ -130,6 +126,6 @@ public class XSSFFileHandler extends Spr
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void testExtractor() throws Exception {
- handleExtracting(new File("test-data/spreadsheet/56278.xlsx"));
+ handleExtracting(new File("test-data/spreadsheet/ref-56737.xlsx"));
}
}
\ 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