Trying to fix the wrong xmlinputfactory on gump run
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1693830 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6b8af03c42
commit
77315b425f
@ -26,6 +26,8 @@ import java.lang.reflect.Field;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.xml.stream.XMLInputFactory;
|
||||||
|
|
||||||
import org.apache.poi.sl.draw.Drawable;
|
import org.apache.poi.sl.draw.Drawable;
|
||||||
import org.apache.poi.util.JvmBugs;
|
import org.apache.poi.util.JvmBugs;
|
||||||
import org.apache.poi.xslf.XSLFTestDataSamples;
|
import org.apache.poi.xslf.XSLFTestDataSamples;
|
||||||
@ -44,6 +46,7 @@ public class TestPPTX2PNG {
|
|||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void activateJaxpDebug() {
|
public static void activateJaxpDebug() {
|
||||||
jaxpDebugEnable = setDebugFld(true);
|
jaxpDebugEnable = setDebugFld(true);
|
||||||
|
fixDefaultInputFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
@ -66,6 +69,22 @@ public class TestPPTX2PNG {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
@Test
|
||||||
public void render() throws Exception {
|
public void render() throws Exception {
|
||||||
String[] testFiles = {"backgrounds.pptx","layouts.pptx", "sample.pptx", "shapes.pptx", "themes.pptx",};
|
String[] testFiles = {"backgrounds.pptx","layouts.pptx", "sample.pptx", "shapes.pptx", "themes.pptx",};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user