From a227fa944383878432655dab2260f8a464a62d59 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Fri, 13 Oct 2023 09:25:13 +0000 Subject: integration-tests: Enable testing extracting for OPCFileHandler and fix single test Enable running "extract" also for OPCFileHandler Add additional expected failures in stress.xls git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912933 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/stress/OPCFileHandler.java | 11 ++++------- test-data/spreadsheet/stress.xls | Bin 58368 -> 99840 bytes 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/poi-integration/src/test/java/org/apache/poi/stress/OPCFileHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/OPCFileHandler.java index 7ad6e44488..68234bc030 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/OPCFileHandler.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/OPCFileHandler.java @@ -19,10 +19,11 @@ package org.apache.poi.stress; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.BufferedInputStream; import java.io.File; -import java.io.FileInputStream; import java.io.InputStream; import java.io.PushbackInputStream; +import java.nio.file.Files; import java.util.Set; import org.apache.poi.openxml4j.opc.ContentTypes; @@ -61,17 +62,13 @@ public class OPCFileHandler extends AbstractFileHandler { } } - @Override - public void handleExtracting(File file) { - // text-extraction is not possible currently for these types of files - } - // a test-case to test this locally without executing the full TestAllFiles @Test void test() throws Exception { File file = new File("test-data/diagram/test.vsdx"); - try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) { + try (InputStream stream = new BufferedInputStream( + new PushbackInputStream(Files.newInputStream(file.toPath()), 100000))) { handleFile(stream, file.getPath()); } diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls index 709bc401f0..203dae720a 100644 Binary files a/test-data/spreadsheet/stress.xls and b/test-data/spreadsheet/stress.xls differ -- cgit v1.2.3