diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2008-05-09 12:30:40 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2008-05-09 12:30:40 +0000 |
commit | 5a0f93d17cc2d4cddca9f9aa0ccde76f52bb08e0 (patch) | |
tree | 94c4b4de9aec33ba9a33602d55821ebb35814f57 /test/java/org/apache | |
parent | 8e7dceedd34226cfe8d6fc922186d5d4c3c6c1e3 (diff) | |
download | xmlgraphics-fop-5a0f93d17cc2d4cddca9f9aa0ccde76f52bb08e0.tar.gz xmlgraphics-fop-5a0f93d17cc2d4cddca9f9aa0ccde76f52bb08e0.zip |
Checkstyle and minor typo fixes
Set svn:keywords and svn:eol-style properties on new files
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@654783 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache')
5 files changed, 46 insertions, 46 deletions
diff --git a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java index d216d583a..ff14e5f0b 100644 --- a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java +++ b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java @@ -33,7 +33,7 @@ import org.apache.fop.render.pdf.BasePDFTestCase; import org.xml.sax.SAXException; /** - * Basic runtime test for FOP's font configuration. It is used to verify that + * Basic runtime test for FOP's font configuration. It is used to verify that * nothing obvious is broken after compiling. */ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { @@ -59,7 +59,7 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { } protected void initConfig() throws Exception { - fopFactory.setUserConfig(getUserConfig()); + fopFactory.setUserConfig(getUserConfig()); } protected void convertFO() throws Exception { @@ -70,7 +70,7 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); convertFO(foFile, foUserAgent, dumpOutput); } - + /** * get test FOP config File * @return fo test filepath @@ -82,9 +82,9 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { /** * get test FOP Configuration * @return fo test filepath - * @throws IOException - * @throws SAXException - * @throws ConfigurationException + * @throws IOException + * @throws SAXException + * @throws ConfigurationException */ protected Configuration getUserConfig(String configString) throws ConfigurationException, SAXException, IOException { return cfgBuilder.build(new ByteArrayInputStream(configString.getBytes())); @@ -114,11 +114,11 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { /** * get test FOP Configuration * @return fo test filepath - * @throws IOException - * @throws SAXException - * @throws ConfigurationException + * @throws IOException + * @throws SAXException + * @throws ConfigurationException */ protected Configuration getUserConfig() throws ConfigurationException, SAXException, IOException { return cfgBuilder.buildFromFile(getUserConfigFile()); - } + } } diff --git a/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java b/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java index 5202e837a..f915a2060 100644 --- a/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java +++ b/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java @@ -15,7 +15,7 @@ * limitations under the License. */ -/* $Id: $ */ +/* $Id$ */ package org.apache.fop.config; diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java index b37abdf0d..013a622a4 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java @@ -68,26 +68,26 @@ import org.apache.fop.util.ConsoleEventListenerForTests; 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 @@ public class LayoutEngineTester { fopFactory.getFontManager().setBase14KerningEnabled(false); fopFactoryWithBase14Kerning.getFontManager().setBase14KerningEnabled(true); } - + private Templates getTestcase2FOStylesheet() throws TransformerConfigurationException { if (testcase2fo == null) { //Load and cache stylesheet @@ -107,7 +107,7 @@ public class LayoutEngineTester { } return testcase2fo; } - + private Templates getTestcase2ChecksStylesheet() throws TransformerConfigurationException { if (testcase2checks == null) { //Load and cache stylesheet @@ -116,7 +116,7 @@ public class LayoutEngineTester { } return testcase2checks; } - + /** * Runs a single layout engine test case. * @param testFile Test case to run @@ -125,14 +125,14 @@ public class LayoutEngineTester { * @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 @@ public class LayoutEngineTester { 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 @@ public class LayoutEngineTester { 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 @@ public class LayoutEngineTester { 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 @@ public class LayoutEngineTester { checks.add(createCheck((Element)node)); } } - + if (checks.size() == 0) { throw new RuntimeException("No checks are available!"); } @@ -235,7 +235,7 @@ public class LayoutEngineTester { check.check(result); } } - + /** * Save the area tree XML for later inspection. * @param doc area tree as a DOM document diff --git a/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java b/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java index 7c66a0ceb..29a77a932 100644 --- a/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java +++ b/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java @@ -112,10 +112,10 @@ public class BasePDFTestCase extends AbstractFOPTestCase { } 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"); diff --git a/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java b/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java index 96167ceb0..2fc62c6d1 100644 --- a/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java +++ b/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java @@ -31,7 +31,7 @@ public class PDFAConformanceTestCase extends BasePDFTestCase { 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 @@ public class PDFAConformanceTestCase extends BasePDFTestCase { 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 @@ public class PDFAConformanceTestCase extends BasePDFTestCase { 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 @@ public class PDFAConformanceTestCase extends BasePDFTestCase { 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 @@ public class PDFAConformanceTestCase extends BasePDFTestCase { //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 @@ public class PDFAConformanceTestCase extends BasePDFTestCase { //Good! } } - + /** * Test exception when PDF/A-1 is enabled and images. * @throws Exception if the test fails |