diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-12-30 21:09:08 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-12-30 21:09:08 +0000 |
commit | 4823d0cbd4add5a5dbb99ce52acb61921362f5b5 (patch) | |
tree | 39c60b67ac10b7f9b76897d0aaae7e545b68d093 /poi-integration/src | |
parent | e35347157de67687924267a7fd012a54ae4e9080 (diff) | |
download | poi-4823d0cbd4add5a5dbb99ce52acb61921362f5b5.tar.gz poi-4823d0cbd4add5a5dbb99ce52acb61921362f5b5.zip |
refactor CopyCompare again
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896543 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-integration/src')
-rw-r--r-- | poi-integration/src/test/java/org/apache/poi/stress/HPSFFileHandler.java | 14 |
1 files changed, 3 insertions, 11 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 32c25a78d7..fff7daa8ec 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 @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeFalse; @@ -27,11 +28,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.PrintStream; -import java.nio.charset.StandardCharsets; import java.util.Set; -import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream; import org.apache.poi.examples.hpsf.CopyCompare; import org.apache.poi.hpsf.DocumentSummaryInformation; import org.apache.poi.hpsf.HPSFPropertiesOnlyDocument; @@ -128,14 +126,8 @@ public class HPSFFileHandler extends POIFSFileHandler { public void handleAdditional(File file) throws Exception { assumeFalse(EXCLUDES_HANDLE_ADD.contains(file.getParentFile().getName()+"/"+file.getName())); - try (UnsynchronizedByteArrayOutputStream bos = new UnsynchronizedByteArrayOutputStream()) { - 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)); - } - } + boolean result = CopyCompare.compare(file.getAbsolutePath(), copyOutput.get().getAbsolutePath()); + assertTrue(result); } |