poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1693830 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java
Date Sun, 02 Aug 2015 21:29:24 GMT
Author: kiwiwings
Date: Sun Aug  2 21:29:23 2015
New Revision: 1693830

URL: http://svn.apache.org/r1693830
Log:
Trying to fix the wrong xmlinputfactory on gump run

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=1693830&r1=1693829&r2=1693830&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 Sun Aug
 2 21:29:23 2015
@@ -26,6 +26,8 @@ import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.xml.stream.XMLInputFactory;
+
 import org.apache.poi.sl.draw.Drawable;
 import org.apache.poi.util.JvmBugs;
 import org.apache.poi.xslf.XSLFTestDataSamples;
@@ -44,6 +46,7 @@ public class TestPPTX2PNG {
     @BeforeClass
     public static void activateJaxpDebug() {
         jaxpDebugEnable = setDebugFld(true);
+        fixDefaultInputFactory();
     }
 
     @AfterClass
@@ -65,6 +68,22 @@ public class TestPPTX2PNG {
             return false;
         }
     }
+
+    private static void fixDefaultInputFactory() {
+        String originalValue = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
+        try {
+            Field fld = XMLInputFactory.class.getDeclaredField("DEFAULIMPL");
+            fld.setAccessible(true);
+            String val = (String)fld.get(null);
+            if (!originalValue.equals(val)) {
+                System.out.println("DefaultXMLInputFactory illegal changed to: "+val);
+                fld.set(null, originalValue);
+            }
+        } catch (Exception e) {
+            // ignore
+        }
+    }
+    
     
     @Test
     public void render() throws Exception {



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


Mime
View raw message