diff options
author | Mehdi Houshmand <mehdi@apache.org> | 2012-06-22 08:27:42 +0000 |
---|---|---|
committer | Mehdi Houshmand <mehdi@apache.org> | 2012-06-22 08:27:42 +0000 |
commit | a97e0be88b38483a36aa5101df08f370a5f53433 (patch) | |
tree | fd6651f55d8a6243a62ddf155dcc5478066d8a51 /test | |
parent | c36ffee9dfbf111899bbca5f994e334ca6b95011 (diff) | |
download | xmlgraphics-fop-a97e0be88b38483a36aa5101df08f370a5f53433.tar.gz xmlgraphics-fop-a97e0be88b38483a36aa5101df08f370a5f53433.zip |
Predominantly clean up and javadocs, very little functional change here
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_URI_Unification@1352800 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
7 files changed, 27 insertions, 15 deletions
diff --git a/test/java/org/apache/fop/BasicPDFTranscoderTestCase.java b/test/java/org/apache/fop/BasicPDFTranscoderTestCase.java index de35db94e..0f20a1967 100644 --- a/test/java/org/apache/fop/BasicPDFTranscoderTestCase.java +++ b/test/java/org/apache/fop/BasicPDFTranscoderTestCase.java @@ -20,6 +20,7 @@ package org.apache.fop; import org.apache.batik.transcoder.Transcoder; + import org.apache.fop.svg.PDFTranscoder; /** diff --git a/test/java/org/apache/fop/afp/AFPResourceManagerTestCase.java b/test/java/org/apache/fop/afp/AFPResourceManagerTestCase.java index 27a3a41d0..21540221f 100644 --- a/test/java/org/apache/fop/afp/AFPResourceManagerTestCase.java +++ b/test/java/org/apache/fop/afp/AFPResourceManagerTestCase.java @@ -20,6 +20,7 @@ package org.apache.fop.afp; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import org.junit.Before; @@ -41,7 +42,8 @@ public class AFPResourceManagerTestCase { @Before public void setUp() throws IOException { - sut = new AFPResourceManager(ResourceResolverFactory.createDefaultWrapper()); + sut = new AFPResourceManager(ResourceResolverFactory.createDefaultInternalResourceResolver( + new File(".").toURI())); AFPPaintingState paintingState = new AFPPaintingState(); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); DataStream stream = sut.createDataStream(paintingState, outStream); diff --git a/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTestCase.java b/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTestCase.java index 6d0daa2be..ee2fd7876 100644 --- a/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTestCase.java +++ b/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTestCase.java @@ -39,9 +39,8 @@ public class CharactersetEncoderTestCase { @Before public void setUp() { - singlebyteEncoder = CharactersetEncoder.newInstance("cp500", CharacterSetType.SINGLE_BYTE); - doublebyteEncoder = CharactersetEncoder.newInstance("cp937", - CharacterSetType.DOUBLE_BYTE_LINE_DATA); + singlebyteEncoder = CharacterSetType.SINGLE_BYTE.getEncoder("cp500"); + doublebyteEncoder = CharacterSetType.DOUBLE_BYTE_LINE_DATA.getEncoder("cp937"); } // This is just an arbitrary CJK string diff --git a/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java b/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java index 7a427c548..35748743f 100644 --- a/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java +++ b/test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java @@ -24,8 +24,8 @@ import java.io.File; import org.junit.Before; import org.junit.Test; -import org.apache.fop.apps.io.ResourceResolverFactory; import org.apache.fop.apps.io.InternalResourceResolver; +import org.apache.fop.apps.io.ResourceResolverFactory; import static org.junit.Assert.assertEquals; @@ -34,8 +34,8 @@ import static org.junit.Assert.assertEquals; */ public class DejaVuLGCSerifTestCase { - private InternalResourceResolver resolver = new InternalResourceResolver(new File(".").toURI(), - ResourceResolverFactory.createDefaultResourceResolver()); + private InternalResourceResolver resolver = + ResourceResolverFactory.createDefaultInternalResourceResolver(new File(".").toURI()); private CustomFont font; /** diff --git a/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java b/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java index f80ce7521..b1dc571f9 100644 --- a/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java +++ b/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java @@ -25,8 +25,8 @@ import java.net.URI; import org.junit.Test; -import org.apache.fop.apps.io.ResourceResolverFactory; import org.apache.fop.apps.io.InternalResourceResolver; +import org.apache.fop.apps.io.ResourceResolverFactory; import org.apache.fop.fonts.EncodingMode; import static org.junit.Assert.assertFalse; @@ -42,18 +42,19 @@ public class TTFFontLoaderTestCase { boolean useComplexScriptFeatures = false; File file = new File("test/resources/fonts/ttf/DejaVuLGCSerif.ttf"); URI absoluteFilePath = file.toURI(); - InternalResourceResolver resolver = ResourceResolverFactory.createDefaultWrapper(); + InternalResourceResolver resourceResolver = ResourceResolverFactory.createDefaultInternalResourceResolver( + new File(".").toURI()); String fontName = "Deja Vu"; boolean embedded = false; boolean useKerning = true; TTFFontLoader fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, - EncodingMode.AUTO, useKerning, useComplexScriptFeatures, resolver); + EncodingMode.AUTO, useKerning, useComplexScriptFeatures, resourceResolver); assertTrue(fontLoader.getFont().hasKerningInfo()); useKerning = false; fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, EncodingMode.AUTO, - useKerning, useComplexScriptFeatures, resolver); + useKerning, useComplexScriptFeatures, resourceResolver); assertFalse(fontLoader.getFont().hasKerningInfo()); } } diff --git a/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java b/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java index a781c3c8a..ac9df4046 100644 --- a/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java +++ b/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java @@ -19,10 +19,14 @@ package org.apache.fop.pdf; +import java.io.File; +import java.net.URI; + import org.junit.Test; -import org.apache.fop.apps.io.ResourceResolverFactory; 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.CIDSubset; import org.apache.fop.fonts.MultiByteFont; @@ -56,7 +60,11 @@ public class PDFFactoryTestCase { } PDFDocument doc = new PDFDocument("Test"); PDFFactory pdfFactory = new PDFFactory(doc); - MockedFont font = new MockedFont(ResourceResolverFactory.createDefaultWrapper()); + URI thisURI = new File(".").toURI(); + ResourceResolver resolver = ResourceResolverFactory.createDefaultResourceResolver(); + InternalResourceResolver resourceResolver = ResourceResolverFactory.createInternalResourceResolver( + thisURI, resolver); + MockedFont font = new MockedFont(resourceResolver); PDFFont pdfDejaVu = pdfFactory.makeFont("DejaVu", "DejaVu", "TTF", font, font); assertEquals("/EAAAAA+DejaVu", pdfDejaVu.getBaseFont().toString()); diff --git a/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java b/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java index a48d75462..93a48a62b 100644 --- a/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java +++ b/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java @@ -22,6 +22,7 @@ package org.apache.fop.render.pdf; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.net.URI; import java.util.List; import java.util.Map; @@ -221,9 +222,9 @@ public class PDFRendererConfiguratorTestCase extends @Test public void testSetProfile() throws Exception { - String testString = "this string is purely for testing and has no contextual meaning"; + String testString = "this.uri.is.purely.for.testing.and.has.no.contextual.meaning"; parseConfigMockUtil(createBuilder().setOutputProfile(testString)); - verify(pdfUtil).setOutputProfileURI(testString); + verify(pdfUtil).setOutputProfileURI(URI.create(testString)); } @Test |