diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2020-11-04 22:03:45 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2020-11-04 22:03:45 +0000 |
commit | 9e5790d00453160d6072f91989e769bd1c87f30f (patch) | |
tree | cd4c5940dff6a92cfca76c51ca3d0a4178060cb0 | |
parent | b27bb4f41338c5d9374d1d9c89439c456017d6d9 (diff) | |
download | poi-9e5790d00453160d6072f91989e769bd1c87f30f.tar.gz poi-9e5790d00453160d6072f91989e769bd1c87f30f.zip |
test also render to SVG, PDF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1883130 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java index 706f4ea8a6..ab59877dac 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java @@ -23,6 +23,7 @@ import static java.util.Arrays.asList; import static org.junit.Assume.assumeFalse; import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -54,6 +55,12 @@ public class TestPPTX2PNG { "customGeo.pptx, customGeo.ppt, wrench.emf, santa.wmf, missing-moveto.ppt, " + "64716_image1.wmf, 64716_image2.wmf, 64716_image3.wmf"; + private static final String svgFiles = + "bug64693.pptx"; + + private static final String pdfFiles = + "alterman_security.ppt"; + @BeforeClass public static void checkHslf() { try { @@ -78,29 +85,38 @@ public class TestPPTX2PNG { @Test public void render() throws Exception { assumeFalse("ignore HSLF (.ppt) / HEMF (.emf) / HWMF (.wmf) files in no-scratchpad run", xslfOnly && pptFile.matches(".*\\.(ppt|emf|wmf)$")); + PPTX2PNG.main(getArgs("null")); + if (svgFiles.contains(pptFile)) { + PPTX2PNG.main(getArgs("svg")); + } + if (pdfFiles.contains(pptFile)) { + PPTX2PNG.main(getArgs("pdf")); + } + } - // bug64693.pptx - + private String[] getArgs(String format) throws IOException { final List<String> args = new ArrayList<>(asList( - "-format", "null", // png,gif,jpg,svg or null for test - "-slide", "-1", // -1 for all - "-outdir", new File("build/tmp/").getCanonicalPath(), - "-outpat", "${basename}-${slideno}-${ext}.${format}", - // "-dump", new File("build/tmp/", pptFile+".json").getCanonicalPath(), - "-dump", "null", - "-quiet", - "-fixside", "long", - "-scale", "800" + "-format", format, // png,gif,jpg,svg,pdf or null for test + "-slide", "-1", // -1 for all + "-outdir", new File("build/tmp/").getCanonicalPath(), + "-outpat", "${basename}-${slideno}-${ext}.${format}", + // "-dump", new File("build/tmp/", pptFile+".json").getCanonicalPath(), + "-dump", "null", + "-quiet", + // "-charset", "GBK", + // "-emfHeaderBounds", + "-fixside", "long", + "-scale", "800" )); if ("bug64693.pptx".equals(pptFile)) { args.addAll(asList( - "-charset", "GBK" + "-charset", "GBK" )); } args.add((basedir == null ? samples.getFile(pptFile) : new File(basedir, pptFile)).getAbsolutePath()); - PPTX2PNG.main(args.toArray(new String[0])); + return args.toArray(new String[0]); } } |