]> source.dussan.org Git - poi.git/commitdiff
Regression: Add unit-test which triggers more code deep inside XSLF to have some...
authorDominik Stadler <centic@apache.org>
Sat, 2 Apr 2016 06:38:39 +0000 (06:38 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 2 Apr 2016 06:38:39 +0000 (06:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1737466 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
test-data/slideshow/aascu.org_workarea_downloadasset.aspx_id=5864.pptx [new file with mode: 0755]

index 9b6f448954f538b0e2e37b3ceca5cdbff4f47e4e..64dde4e66970d12fab0ae4fc027552363dad2600 100644 (file)
@@ -23,12 +23,15 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;\r
 import static org.junit.Assert.fail;\r
 \r
-import java.awt.Color;\r
+import java.awt.*;\r
+import java.awt.image.BufferedImage;\r
 import java.io.IOException;\r
 import java.util.List;\r
 \r
+import org.apache.poi.sl.draw.DrawFactory;\r
 import org.apache.poi.sl.draw.geom.TestPresetGeometries;\r
 import org.apache.poi.sl.usermodel.Placeholder;\r
+import org.apache.poi.sl.usermodel.Slide;\r
 import org.apache.poi.sl.usermodel.StrokeStyle.LineCap;\r
 import org.apache.poi.sl.usermodel.StrokeStyle.LineDash;\r
 import org.apache.poi.util.Units;\r
@@ -345,4 +348,32 @@ public class TestXSLFSimpleShape {
         \r
         ppt.close();\r
     }\r
+\r
+    @SuppressWarnings("Duplicates")\r
+    @Test\r
+    public void testArrayStoreException() throws IOException {\r
+        XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("aascu.org_workarea_downloadasset.aspx_id=5864.pptx");\r
+        Dimension pgsize = ppt.getPageSize();\r
+\r
+        for (Slide<?,?> s : ppt.getSlides()) {\r
+            //System.out.println("Slide: " + s);\r
+\r
+            BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_ARGB);\r
+            Graphics2D graphics = img.createGraphics();\r
+            DrawFactory.getInstance(graphics).fixFonts(graphics);\r
+\r
+            // default rendering options\r
+            graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r
+            graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\r
+            graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);\r
+            graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);\r
+\r
+            // draw stuff\r
+            s.draw(graphics);\r
+\r
+            graphics.dispose();\r
+            img.flush();\r
+        }\r
+        ppt.close();\r
+    }\r
 }
\ No newline at end of file
diff --git a/test-data/slideshow/aascu.org_workarea_downloadasset.aspx_id=5864.pptx b/test-data/slideshow/aascu.org_workarea_downloadasset.aspx_id=5864.pptx
new file mode 100755 (executable)
index 0000000..05c30aa
Binary files /dev/null and b/test-data/slideshow/aascu.org_workarea_downloadasset.aspx_id=5864.pptx differ