aboutsummaryrefslogtreecommitdiffstats
path: root/poi-integration/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'poi-integration/src/test')
-rw-r--r--poi-integration/src/test/java/org/apache/poi/stress/BaseIntegrationTest.java1
-rw-r--r--poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java12
2 files changed, 9 insertions, 4 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/BaseIntegrationTest.java b/poi-integration/src/test/java/org/apache/poi/stress/BaseIntegrationTest.java
index 47a80d198b..2ae90a930d 100644
--- a/poi-integration/src/test/java/org/apache/poi/stress/BaseIntegrationTest.java
+++ b/poi-integration/src/test/java/org/apache/poi/stress/BaseIntegrationTest.java
@@ -37,6 +37,7 @@ import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
* types of files/exceptions, e.g. old file formats.
*
*/
+@SuppressWarnings({"java:S2187", "unused"})
public class BaseIntegrationTest {
private final File rootDir;
private final String file;
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java
index 6f9571564f..ba60188040 100644
--- a/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java
+++ b/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java
@@ -17,6 +17,8 @@
package org.apache.poi.stress;
import static org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM;
+import static org.apache.poi.xssf.XSSFTestDataSamples.getSampleFile;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -219,12 +221,14 @@ class XSSFFileHandler extends SpreadsheetHandler {
}
@Test
- void testExtracting() throws Exception {
- handleExtracting(new File("test-data/spreadsheet/ref-56737.xlsx"));
+ void testExtracting() {
+ File testFile = getSampleFile("ref-56737.xlsx");
+ assertDoesNotThrow(() -> handleExtracting(testFile));
}
@Test
- void testAdditional() throws Exception {
- handleAdditional(new File("test-data/spreadsheet/poc-xmlbomb.xlsx"));
+ void testAdditional() {
+ File testFile = getSampleFile("poc-xmlbomb.xlsx");
+ assertDoesNotThrow(() -> handleAdditional(testFile));
}
}