aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache
diff options
context:
space:
mode:
authorMehdi Houshmand <mehdi@apache.org>2012-01-30 09:49:22 +0000
committerMehdi Houshmand <mehdi@apache.org>2012-01-30 09:49:22 +0000
commitc5c6ddef0cb6c90ea71e306f63474fd67ed46f6a (patch)
treeb9a6f738110a23fd12e15e19eed2b75ef55e61db /test/java/org/apache
parentf02df0822b06b0d4a3fad950f4dd335515ebe563 (diff)
downloadxmlgraphics-fop-c5c6ddef0cb6c90ea71e306f63474fd67ed46f6a.tar.gz
xmlgraphics-fop-c5c6ddef0cb6c90ea71e306f63474fd67ed46f6a.zip
Bugzilla#52513: Moved FOUserAgent to the constructor of the Renderers
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1237582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache')
-rw-r--r--test/java/org/apache/fop/URIResolutionTestCase.java15
-rw-r--r--test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java9
-rw-r--r--test/java/org/apache/fop/layoutengine/LayoutEngineTestCase.java6
3 files changed, 13 insertions, 17 deletions
diff --git a/test/java/org/apache/fop/URIResolutionTestCase.java b/test/java/org/apache/fop/URIResolutionTestCase.java
index 97d1c9c25..490486158 100644
--- a/test/java/org/apache/fop/URIResolutionTestCase.java
+++ b/test/java/org/apache/fop/URIResolutionTestCase.java
@@ -39,19 +39,21 @@ import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.w3c.dom.Document;
+
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.xpath.XPathAPI;
+import org.apache.xpath.objects.XObject;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.render.xml.XMLRenderer;
-import org.apache.xpath.XPathAPI;
-import org.apache.xpath.objects.XObject;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.w3c.dom.Document;
/**
* Tests URI resolution facilities.
@@ -160,8 +162,7 @@ public class URIResolutionTestCase extends AbstractFOPTest {
TransformerHandler athandler = tfactory.newTransformerHandler();
athandler.setResult(domres);
- XMLRenderer atrenderer = new XMLRenderer();
- atrenderer.setUserAgent(ua);
+ XMLRenderer atrenderer = new XMLRenderer(ua);
atrenderer.setContentHandler(athandler);
ua.setRendererOverride(atrenderer);
diff --git a/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java b/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java
index a0de2e8ab..1f8abb9be 100644
--- a/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java
+++ b/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java
@@ -97,10 +97,9 @@ public class AreaTreeParserTestCase extends AbstractIntermediateTest {
Renderer targetRenderer = userAgent.getRendererFactory().createRenderer(
userAgent, getTargetMIME());
- XMLRenderer renderer = new XMLRenderer();
+ XMLRenderer renderer = new XMLRenderer(userAgent);
renderer.mimicRenderer(targetRenderer);
renderer.setContentHandler(handler);
- renderer.setUserAgent(userAgent);
userAgent.setRendererOverride(renderer);
@@ -131,12 +130,10 @@ public class AreaTreeParserTestCase extends AbstractIntermediateTest {
TransformerHandler handler = testAssistant.getTransformerFactory().newTransformerHandler();
DOMResult domResult = new DOMResult();
handler.setResult(domResult);
- XMLRenderer renderer = new XMLRenderer();
- renderer.setContentHandler(handler);
-
FOUserAgent userAgent = createUserAgent();
+ XMLRenderer renderer = new XMLRenderer(userAgent);
userAgent.setRendererOverride(renderer);
- renderer.setUserAgent(userAgent);
+ renderer.setContentHandler(handler);
FontInfo fontInfo = new FontInfo();
AreaTreeModel treeModel = new RenderPagesModel(userAgent,
diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestCase.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestCase.java
index 46908a448..6a0d424e9 100644
--- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestCase.java
+++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestCase.java
@@ -150,8 +150,7 @@ public class LayoutEngineTestCase {
ua.getEventBroadcaster().addEventListener(
new ConsoleEventListenerForTests(testFile.getName(), EventSeverity.WARN));
- XMLRenderer atrenderer = new XMLRenderer();
- atrenderer.setUserAgent(ua);
+ XMLRenderer atrenderer = new XMLRenderer(ua);
atrenderer.setContentHandler(athandler);
ua.setRendererOverride(atrenderer);
fop = effFactory.newFop(ua);
@@ -208,8 +207,7 @@ public class LayoutEngineTestCase {
ua.getEventBroadcaster().addEventListener(
new ConsoleEventListenerForTests(testFile.getName(), EventSeverity.WARN));
- IFRenderer ifRenderer = new IFRenderer();
- ifRenderer.setUserAgent(ua);
+ IFRenderer ifRenderer = new IFRenderer(ua);
IFSerializer serializer = new IFSerializer();
serializer.setContext(new IFContext(ua));