diff options
Diffstat (limited to 'src/scratchpad/testcases/org/apache/poi/hdgf/dev/TestVSDDumper.java')
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hdgf/dev/TestVSDDumper.java | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hdgf/dev/TestVSDDumper.java b/src/scratchpad/testcases/org/apache/poi/hdgf/dev/TestVSDDumper.java index 10f131b7c4..302eacc928 100644 --- a/src/scratchpad/testcases/org/apache/poi/hdgf/dev/TestVSDDumper.java +++ b/src/scratchpad/testcases/org/apache/poi/hdgf/dev/TestVSDDumper.java @@ -20,32 +20,26 @@ ==================================================================== */ package org.apache.poi.hdgf.dev; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + import java.io.File; import java.io.PrintStream; import org.apache.poi.POIDataSamples; import org.apache.poi.util.NullPrintStream; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; public class TestVSDDumper { - private static PrintStream oldStdOut; - - @BeforeAll - public static void muteStdout() { - oldStdOut = System.out; - System.setOut(new NullPrintStream()); - } - - @AfterAll - public static void restoreStdout() { - System.setOut(oldStdOut); - } - @Test - void main() throws Exception { - File file = POIDataSamples.getDiagramInstance().getFile("Test_Visio-Some_Random_Text.vsd"); - VSDDumper.main(new String[] { file.getAbsolutePath() }); + void main() { + PrintStream oldStdOut = System.out; + System.setOut(new NullPrintStream()); + try { + File file = POIDataSamples.getDiagramInstance().getFile("Test_Visio-Some_Random_Text.vsd"); + String[] args = { file.getAbsolutePath() }; + assertDoesNotThrow(() -> VSDDumper.main(args)); + } finally { + System.setOut(oldStdOut); + } } }
\ No newline at end of file |