poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1692944 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java
Date Mon, 27 Jul 2015 20:24:09 GMT
Author: kiwiwings
Date: Mon Jul 27 20:24:09 2015
New Revision: 1692944

URL: http://svn.apache.org/r1692944
Log:
temporary activate jaxp debugging to find jaxb/stax error on gump build

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java?rev=1692944&r1=1692943&r2=1692944&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java Mon Jul
27 20:24:09 2015
@@ -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",};



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message