diff options
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java | 30 |
1 files changed, 30 insertions, 0 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 7d962fc433..14f92e2bbe 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java @@ -22,12 +22,15 @@ package org.apache.poi.xslf.usermodel; import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
+import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.apache.poi.sl.draw.Drawable;
import org.apache.poi.util.JvmBugs;
import org.apache.poi.xslf.XSLFTestDataSamples;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -36,6 +39,33 @@ import org.junit.Test; * @author Yegor Kozlov
*/
public class TestPPTX2PNG {
+ private static boolean jaxpDebugEnable = false;
+
+ @BeforeClass
+ public static void activateJaxpDebug() {
+ jaxpDebugEnable = setDebugFld(true);
+ }
+
+ @AfterClass
+ public static void resetJaxpDebug() {
+ setDebugFld(jaxpDebugEnable);
+ }
+
+ private static boolean setDebugFld(boolean enable) {
+ // enable jaxp debugging because of jaxb/stax error in gump build
+ try {
+ Class<?> clz = Class.forName("javax.xml.stream.FactoryFinder");
+ Field fld = clz.getDeclaredField("debug");
+ fld.setAccessible(true);
+ boolean isDebug = (Boolean)fld.get(null);
+ fld.set(null, enable);
+ return isDebug;
+ } catch (Exception e) {
+ // ignore
+ return false;
+ }
+ }
+
@Test
public void render() throws Exception {
String[] testFiles = {"backgrounds.pptx","layouts.pptx", "sample.pptx", "shapes.pptx", "themes.pptx",};
|