]> source.dussan.org Git - poi.git/commitdiff
try to fix test issue
authorPJ Fanning <fanningpj@apache.org>
Thu, 30 Dec 2021 20:41:51 +0000 (20:41 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 30 Dec 2021 20:41:51 +0000 (20:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896542 13f79535-47bb-0310-9956-ffa450edef68

poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java

index 9809a7a11f8799fa8721f042fdf3198e86f088cd..32c25a78d738461213b28f91febcbd593d95c661 100644 (file)
@@ -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));
+            }
         }
     }