Revert changes to integration-test-framework to not make tests fail with strange errors about entity expansion limits

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1722425 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-12-31 08:23:04 +00:00
parent 5344aa12cd
commit c7baa89709

View File

@ -47,18 +47,12 @@ public class XSSFFileHandler extends SpreadsheetHandler {
// ignore password protected files
if (POIXMLDocumentHandler.isEncrypted(stream)) return;
final XSSFWorkbook wb;
// 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 XSSFWorkbook wb;
wb = new XSSFWorkbook(new ByteArrayInputStream(bytes));
}
// use the combined handler for HSSF/XSSF
handleWorkbook(wb, ".xlsx");
@ -72,6 +66,8 @@ public class XSSFFileHandler extends SpreadsheetHandler {
// and finally ensure that exporting to XML works
exportToXML(wb);
checkXSSFReader(OPCPackage.open(new ByteArrayInputStream(bytes)));
}
@ -119,7 +115,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
// 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 SpreadsheetHandler {
// 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"));
}
}