summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java2
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/openxml4j/TestOPCPackageFileLimit.java2
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java6
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java6
4 files changed, 13 insertions, 3 deletions
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 160d7059a2..d8c1108906 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
@@ -217,6 +217,8 @@ public class XSSFFileHandler extends SpreadsheetHandler {
}
handleExtracting(file);
+
+ handleAdditional(file);
}
@Test
diff --git a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/TestOPCPackageFileLimit.java b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/TestOPCPackageFileLimit.java
index 017de0a10e..02f81ccd51 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/TestOPCPackageFileLimit.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/TestOPCPackageFileLimit.java
@@ -22,6 +22,7 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.Isolated;
import java.io.File;
import java.io.IOException;
@@ -30,6 +31,7 @@ import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
+@Isolated // changes static values, so other tests should not run at the same time
class TestOPCPackageFileLimit {
@Test
void testWithReducedFileLimit() throws InvalidFormatException {
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java
index be486270ed..220963db79 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java
@@ -67,6 +67,12 @@ public final class TestReadOnlySharedStringsTable {
assertEquals(i1.getString(), rtbl.getItemAt(i).getString());
assertEquals(i1.getString(), rtbl2.getItemAt(i).getString());
}
+
+ // verify invalid indices
+ assertThrows(IllegalStateException.class,
+ () -> rtbl.getItemAt(stbl.getUniqueCount()));
+ assertThrows(IndexOutOfBoundsException.class,
+ () -> rtbl.getItemAt(-1));
}
}
}
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
index 7fa5162a14..9f55214ee5 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
@@ -1085,17 +1085,17 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
int count;
@Override
- public void write(int b) throws IOException {
+ public void write(int b) {
count++;
}
@Override
- public void write(byte[] b) throws IOException {
+ public void write(byte[] b) {
count += b.length;
}
@Override
- public void write(byte[] b, int off, int len) throws IOException {
+ public void write(byte[] b, int off, int len) {
count += len;
}