acumiskey
Mon, 12 May 2008 01:58:51 -0700
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java?rev=655445&r1=655444&r2=655445&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java Mon May 12 01:58:21 2008 @@ -68,26 +68,26 @@ public class LayoutEngineTester { private static final Map CHECK_CLASSES = new java.util.HashMap(); - + // configure fopFactory as desired private FopFactory fopFactory = FopFactory.newInstance(); private FopFactory fopFactoryWithBase14Kerning = FopFactory.newInstance(); - - private SAXTransformerFactory tfactory + + private SAXTransformerFactory tfactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); private Templates testcase2fo; private Templates testcase2checks; - + private File areaTreeBackupDir; - + static { CHECK_CLASSES.put("true", TrueCheck.class); CHECK_CLASSES.put("eval", EvalCheck.class); CHECK_CLASSES.put("element-list", ElementListCheck.class); CHECK_CLASSES.put("result", ResultCheck.class); } - + /** * Constructs a new instance. * @param areaTreeBackupDir Optional directory that receives the generated @@ -98,7 +98,7 @@ fopFactory.getFontManager().setBase14KerningEnabled(false); fopFactoryWithBase14Kerning.getFontManager().setBase14KerningEnabled(true); } - + private Templates getTestcase2FOStylesheet() throws TransformerConfigurationException { if (testcase2fo == null) { //Load and cache stylesheet @@ -107,7 +107,7 @@ } return testcase2fo; } - + private Templates getTestcase2ChecksStylesheet() throws TransformerConfigurationException { if (testcase2checks == null) { //Load and cache stylesheet @@ -116,7 +116,7 @@ } return testcase2checks; } - + /** * Runs a single layout engine test case. * @param testFile Test case to run @@ -125,14 +125,14 @@ * @throws SAXException In case of a problem during SAX processing * @throws ParserConfigurationException In case of a problem with the XML parser setup */ - public void runTest(File testFile) + public void runTest(File testFile) throws TransformerException, SAXException, IOException, ParserConfigurationException { - + DOMResult domres = new DOMResult(); ElementListCollector elCollector = new ElementListCollector(); ElementListObserver.addObserver(elCollector); - + Fop fop; try { @@ -141,47 +141,47 @@ dbf.setValidating(false); DocumentBuilder builder = dbf.newDocumentBuilder(); Document testDoc = builder.parse(testFile); - + XObject xo = XPathAPI.eval(testDoc, "/testcase/cfg/base14kerning"); String s = xo.str(); boolean base14kerning = ("true".equalsIgnoreCase(s)); FopFactory effFactory = (base14kerning ? fopFactoryWithBase14Kerning : fopFactory); - + //Setup Transformer to convert the testcase XML to XSL-FO Transformer transformer = getTestcase2FOStylesheet().newTransformer(); Source src = new DOMSource(testDoc); - + //Setup Transformer to convert the area tree to a DOM TransformerHandler athandler = tfactory.newTransformerHandler(); athandler.setResult(domres); - + //Setup FOP for area tree rendering FOUserAgent ua = effFactory.newFOUserAgent(); ua.setBaseURL(testFile.getParentFile().toURL().toString()); ua.getEventBroadcaster().addEventListener( new ConsoleEventListenerForTests(testFile.getName())); - + XMLRenderer atrenderer = new XMLRenderer(); atrenderer.setUserAgent(ua); atrenderer.setContentHandler(athandler); ua.setRendererOverride(atrenderer); fop = effFactory.newFop(ua); - + SAXResult fores = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, fores); } finally { ElementListObserver.removeObserver(elCollector); } - + Document doc = (Document)domres.getNode(); if (this.areaTreeBackupDir != null) { saveAreaTreeXML(doc, new File(this.areaTreeBackupDir, testFile.getName() + ".at.xml")); } - FormattingResults results = fop.getResults(); + FormattingResults results = fop.getResults(); LayoutResult result = new LayoutResult(doc, elCollector, results); checkAll(testFile, result); } - + /** * Factory method to create checks from DOM elements. * @param el DOM element to create the check from @@ -196,14 +196,14 @@ LayoutEngineCheck instance = (LayoutEngineCheck)c.newInstance(new Object[] {el}); return instance; } catch (Exception e) { - throw new RuntimeException("Error while instantiating check '" + throw new RuntimeException("Error while instantiating check '" + name + "': " + e.getMessage()); } } else { throw new IllegalArgumentException("No check class found: " + name); } } - + /** * Perform all checks on the area tree. * @param testFile Test case XML file @@ -215,7 +215,7 @@ Source src = new StreamSource(testFile); DOMResult res = new DOMResult(); transformer.transform(src, res); - + List checks = new java.util.ArrayList(); Document doc = (Document)res.getNode(); NodeList nodes = doc.getDocumentElement().getChildNodes(); @@ -225,7 +225,7 @@ checks.add(createCheck((Element)node)); } } - + if (checks.size() == 0) { throw new RuntimeException("No checks are available!"); } @@ -235,7 +235,7 @@ check.check(result); } } - + /** * Save the area tree XML for later inspection. * @param doc area tree as a DOM document Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java?rev=655445&r1=655444&r2=655445&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java Mon May 12 01:58:21 2008 @@ -112,10 +112,10 @@ } return e; } - + /** - * get FOP config File - * @return user config file to be used for testing + * get FOP config File + * @return user config file to be used for testing */ protected File getUserConfigFile() { return new File("test/test.xconf"); Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java?rev=655445&r1=655444&r2=655445&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java Mon May 12 01:58:21 2008 @@ -31,7 +31,7 @@ private File foBaseDir = new File("test/xml/pdf-a"); private boolean dumpPDF = Boolean.getBoolean("PDFAConformanceTestCase.dumpPDF"); - + /** * Main constructor * @param name the name of the test case @@ -40,7 +40,7 @@ super(name); } - /** create an FOUserAgent for our tests + /** create an FOUserAgent for our tests * @return an initialized FOUserAgent * */ protected FOUserAgent getUserAgent() { @@ -48,7 +48,7 @@ userAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); return userAgent; } - + /** * Test exception when PDF/A-1 is enabled and everything is as it should. * @throws Exception if the test fails @@ -57,7 +57,7 @@ File foFile = new File(foBaseDir, "minimal-pdf-a.fo"); convertFO(foFile, getUserAgent(), dumpPDF); } - + /** * Test exception when PDF/A-1 is enabled together with encryption. * @throws Exception if the test fails @@ -73,7 +73,7 @@ //Good! } } - + /** * Test exception when PDF/A-1 is enabled and a font is used which is not embedded. * @throws Exception if the test fails @@ -87,7 +87,7 @@ //Good! } } - + /** * Test exception when PDF/A-1 is enabled and images. * @throws Exception if the test fails Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/disabled-testcases.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/disabled-testcases.xml?rev=655445&r1=655444&r2=655445&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/disabled-testcases.xml (original) +++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/disabled-testcases.xml Mon May 12 01:58:21 2008 @@ -189,11 +189,6 @@ placed correctly.</description> </testcase> <testcase> - <name>page-number-citation-last: FOs spanning multiple pages are not properly handled.</name> - <file>page-number-citation-last_basic.xml</file> - <description>Resolution of forward references does not wait until an FO is fully finished when an FO spans multiple pages.</description> - </testcase> - <testcase> <name>IDs are not working on all FO elements</name> <file>page-number-citation_complex_1.xml</file> <description>The "id" attributes are not properly handled for all block-level FO elements.</description> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]