diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java index a7ea1a2db..eb34f70b8 100644 --- a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java +++ b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java @@ -19,14 +19,16 @@ package org.apache.fop.render.pdf; -import org.apache.fop.pdf.PDFCMap; +import java.io.StringWriter; import junit.framework.TestCase; +import org.apache.fop.pdf.CMapBuilder; + /** Simple sanity test of the PDFCmap class */ public class PDFCMapTestCase extends TestCase { - public void testPDFCMapFillInPDF() { + public void testPDFCMapFillInPDF() throws Exception { final String EOL = "\n"; final String expected = "%!PS-Adobe-3.0 Resource-CMap" + EOL @@ -59,10 +61,10 @@ public class PDFCMapTestCase extends TestCase { +"%%EOF" + EOL ; - final PDFCMap m = new PDFCMap("test", null); - final StringBuffer b = new StringBuffer(); - m.fillInPDF(b); - final String actual = b.toString(); + final StringWriter w = new StringWriter(); + final CMapBuilder builder = new CMapBuilder(w, "test"); + builder.writeCMap(); + final String actual = w.getBuffer().toString(); assertEquals("PDFCMap output matches expected PostScript code", expected, actual); } |