Skip to content

Commit

Permalink
integration-tests: Enable testing extracting for OPCFileHandler and f…
Browse files Browse the repository at this point in the history
…ix 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
  • Loading branch information
centic9 committed Oct 13, 2023
1 parent 638a9be commit a227fa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more
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;
Expand Down Expand Up @@ -61,17 +62,13 @@ public void handleFile(InputStream stream, String path) throws Exception {
}
}

@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());
}

Expand Down
Binary file modified test-data/spreadsheet/stress.xls
Binary file not shown.

0 comments on commit a227fa9

Please sign in to comment.