aboutsummaryrefslogtreecommitdiffstats
path: root/test/java
diff options
context:
space:
mode:
authorMehdi Houshmand <mehdi@apache.org>2012-09-19 15:37:57 +0000
committerMehdi Houshmand <mehdi@apache.org>2012-09-19 15:37:57 +0000
commitc9cbf7e0a418fb7735f6d4a42632b867f3dab36c (patch)
tree33a6758d61d589fe3a6163edf8e3e0dbd55b0022 /test/java
parentc5a2f0959ec4116022f8e87cd9114b7b152a6c98 (diff)
downloadxmlgraphics-fop-c9cbf7e0a418fb7735f6d4a42632b867f3dab36c.tar.gz
xmlgraphics-fop-c9cbf7e0a418fb7735f6d4a42632b867f3dab36c.zip
Moved the I/O interfaces to XGC and updated code with new resolution mechanism
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_XGC_URI_Resolution@1387645 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r--test/java/org/apache/fop/URIResolutionTestCase.java5
-rw-r--r--test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java3
-rw-r--r--test/java/org/apache/fop/apps/MutableConfig.java7
-rw-r--r--test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java2
-rw-r--r--test/java/org/apache/fop/apps/io/FontURIResolver.java2
-rw-r--r--test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java10
-rw-r--r--test/java/org/apache/fop/apps/io/TestingResourceResolver.java2
-rw-r--r--test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java2
-rw-r--r--test/java/org/apache/fop/intermediate/TestAssistant.java8
-rw-r--r--test/java/org/apache/fop/pdf/PDFFactoryTestCase.java3
10 files changed, 35 insertions, 9 deletions
diff --git a/test/java/org/apache/fop/URIResolutionTestCase.java b/test/java/org/apache/fop/URIResolutionTestCase.java
index f1dd89725..e1015306e 100644
--- a/test/java/org/apache/fop/URIResolutionTestCase.java
+++ b/test/java/org/apache/fop/URIResolutionTestCase.java
@@ -46,14 +46,15 @@ import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
+import org.apache.xmlgraphics.io.Resource;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
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.FopFactoryBuilder;
import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.apps.io.Resource;
-import org.apache.fop.apps.io.ResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.render.xml.XMLRenderer;
diff --git a/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java b/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java
index 7b033969b..e94403e71 100644
--- a/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java
+++ b/test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java
@@ -21,11 +21,12 @@ import java.net.URI;
import org.junit.Test;
-import org.apache.fop.apps.io.ResourceResolver;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
public class EnvironmentalProfileFactoryTestCase {
private final URI testURI = URI.create("this.is.purely.for.test.purposes");
diff --git a/test/java/org/apache/fop/apps/MutableConfig.java b/test/java/org/apache/fop/apps/MutableConfig.java
index 79f038f24..3ff3c10fa 100644
--- a/test/java/org/apache/fop/apps/MutableConfig.java
+++ b/test/java/org/apache/fop/apps/MutableConfig.java
@@ -24,8 +24,9 @@ import java.util.Set;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
+import org.apache.xmlgraphics.io.ResourceResolver;
-import org.apache.fop.apps.io.ResourceResolver;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.layoutmgr.LayoutManagerMaker;
@@ -130,4 +131,8 @@ public final class MutableConfig implements FopFactoryConfig {
public Map<String, String> getHyphenationPatternNames() {
return delegate.getHyphenationPatternNames();
}
+
+ public FallbackResolver getFallbackResolver() {
+ return delegate.getFallbackResolver();
+ }
}
diff --git a/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java b/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java
index ee337c39d..2131407c1 100644
--- a/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java
+++ b/test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java
@@ -37,6 +37,8 @@ import org.xml.sax.SAXException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
diff --git a/test/java/org/apache/fop/apps/io/FontURIResolver.java b/test/java/org/apache/fop/apps/io/FontURIResolver.java
index d6f836783..40d6c7402 100644
--- a/test/java/org/apache/fop/apps/io/FontURIResolver.java
+++ b/test/java/org/apache/fop/apps/io/FontURIResolver.java
@@ -39,6 +39,8 @@ import org.apache.fop.apps.PDFRendererConfBuilder;
import static org.junit.Assert.assertTrue;
+import org.apache.xmlgraphics.io.Resource;
+
public class FontURIResolver extends BaseURIResolutionTest {
public enum Event {
diff --git a/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java b/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java
index b6b2eea00..6ae34b4f9 100644
--- a/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java
+++ b/test/java/org/apache/fop/apps/io/ResourceResolverFactoryTestCase.java
@@ -36,6 +36,10 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import org.apache.xmlgraphics.io.Resource;
+import org.apache.xmlgraphics.io.ResourceResolver;
+import org.apache.xmlgraphics.io.TempResourceResolver;
+
public class ResourceResolverFactoryTestCase {
private static final byte[] DATA = new byte[]{(byte) 0, (byte) 1, (byte) 2};
@@ -193,10 +197,10 @@ public class ResourceResolverFactoryTestCase {
final ResourceResolver sut;
TestCreateSchemaAwareResourceResolverBuilderHelper() {
- ResourceResolverFactory.SchemaAwareResourceResolverBuilder builder
- = ResourceResolverFactory.createSchemaAwareResourceResolverBuilder(
+ ResourceResolverFactory.SchemeAwareResourceResolverBuilder builder
+ = ResourceResolverFactory.createSchemeAwareResourceResolverBuilder(
defaultResourceResolver);
- builder.registerResourceResolverForSchema(SCHEMA, registedResourceResolver);
+ builder.registerResourceResolverForScheme(SCHEMA, registedResourceResolver);
sut = builder.build();
}
diff --git a/test/java/org/apache/fop/apps/io/TestingResourceResolver.java b/test/java/org/apache/fop/apps/io/TestingResourceResolver.java
index 532353337..f1cd06138 100644
--- a/test/java/org/apache/fop/apps/io/TestingResourceResolver.java
+++ b/test/java/org/apache/fop/apps/io/TestingResourceResolver.java
@@ -24,6 +24,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
abstract class TestingResourceResolver implements ResourceResolver {
private final Map<URI, Object> checker;
diff --git a/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java b/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
index 440b16abb..b2044e3b9 100644
--- a/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
+++ b/test/java/org/apache/fop/apps/io/URIResolverWrapperTestCase.java
@@ -35,6 +35,8 @@ import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
public class URIResolverWrapperTestCase {
private static final List<String> BASE_URIS = Collections.unmodifiableList(Arrays.asList(
diff --git a/test/java/org/apache/fop/intermediate/TestAssistant.java b/test/java/org/apache/fop/intermediate/TestAssistant.java
index 2be41dca1..2b138de55 100644
--- a/test/java/org/apache/fop/intermediate/TestAssistant.java
+++ b/test/java/org/apache/fop/intermediate/TestAssistant.java
@@ -42,8 +42,11 @@ import org.w3c.dom.Element;
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
+import org.apache.fop.apps.EnvironmentProfile;
+import org.apache.fop.apps.EnvironmentalProfileFactory;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FopFactoryBuilder;
+import org.apache.fop.apps.io.ResourceResolverFactory;
/**
* Helper class for running FOP tests.
@@ -115,7 +118,10 @@ public class TestAssistant {
public FopFactory getFopFactory(Document testDoc) {
boolean base14KerningEnabled = isBase14KerningEnabled(testDoc);
boolean strictValidation = isStrictValidation(testDoc);
- FopFactoryBuilder builder = new FopFactoryBuilder(testDir.getParentFile().toURI());
+ EnvironmentProfile envProfile = EnvironmentalProfileFactory.createRestrictedIO(
+ testDir.getParentFile().toURI(),
+ ResourceResolverFactory.createDefaultResourceResolver());
+ FopFactoryBuilder builder = new FopFactoryBuilder(envProfile);
builder.setStrictFOValidation(strictValidation);
builder.getFontManager().setBase14KerningEnabled(base14KerningEnabled);
return builder.build();
diff --git a/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java b/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java
index 971471fa2..5e4b9e2e4 100644
--- a/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java
+++ b/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java
@@ -26,8 +26,9 @@ import org.junit.Test;
import static org.junit.Assert.assertEquals;
+import org.apache.xmlgraphics.io.ResourceResolver;
+
import org.apache.fop.apps.io.InternalResourceResolver;
-import org.apache.fop.apps.io.ResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.fonts.CIDSet;
import org.apache.fop.fonts.CIDSubset;