aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2015-07-27 20:24:09 +0000
committerAndreas Beeker <kiwiwings@apache.org>2015-07-27 20:24:09 +0000
commit77098e5e3e6953c3f6cd9f5c7d381d8536e238f8 (patch)
treed570ff26c73d70705f859d92c3331a7b8e56cb14 /src
parent99f8274bfc38b08921e81bfd738d1658ce9eedca (diff)
downloadpoi-77098e5e3e6953c3f6cd9f5c7d381d8536e238f8.tar.gz
poi-77098e5e3e6953c3f6cd9f5c7d381d8536e238f8.zip
temporary activate jaxp debugging to find jaxb/stax error on gump build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1692944 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java30
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",};