summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java
index 9809a7a11f..32c25a78d7 100644
--- a/poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java
+++ b/poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java
@@ -129,11 +129,12 @@ public class HPSFFileHandler extends POIFSFileHandler {
assumeFalse(EXCLUDES_HANDLE_ADD.contains(file.getParentFile().getName()+"/"+file.getName()));
try (UnsynchronizedByteArrayOutputStream bos = new UnsynchronizedByteArrayOutputStream()) {
- PrintStream psNew = new PrintStream(bos, true, "ISO-8859-1");
- CopyCompare copyCompare = new CopyCompare();
- copyCompare.setOut(psNew);
- CopyCompare.main(new String[]{file.getAbsolutePath(), copyOutput.get().getAbsolutePath()});
- assertEquals("Equal" + NL, bos.toString(StandardCharsets.UTF_8));
+ try (PrintStream psNew = new PrintStream(bos, true, "ISO-8859-1")) {
+ CopyCompare copyCompare = new CopyCompare();
+ copyCompare.setOut(psNew);
+ copyCompare.run(new String[]{file.getAbsolutePath(), copyOutput.get().getAbsolutePath()});
+ assertEquals("Equal" + NL, bos.toString(StandardCharsets.UTF_8));
+ }
}
}