]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Cosmetics only: enabled Checkstyle for test files and fixed resulting errors
authorVincent Hennebert <vhennebert@apache.org>
Tue, 17 Dec 2013 13:15:06 +0000 (13:15 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Tue, 17 Dec 2013 13:15:06 +0000 (13:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1551536 13f79535-47bb-0310-9956-ffa450edef68

198 files changed:
build.xml
checkstyle-suppressions.xml
test/java/org/apache/fop/AbstractBasicTranscoderTest.java
test/java/org/apache/fop/BasicDriverTestCase.java
test/java/org/apache/fop/BasicDriverTestSuite.java
test/java/org/apache/fop/BasicPSTranscoderTestCase.java
test/java/org/apache/fop/DebugHelper.java
test/java/org/apache/fop/DigestFilterTestCase.java
test/java/org/apache/fop/KnuthAlgorithmTestCase.java
test/java/org/apache/fop/URIResolutionTestCase.java
test/java/org/apache/fop/afp/AFPObjectAreaInfoTestCase.java
test/java/org/apache/fop/afp/AFPPaintingStateTestCase.java
test/java/org/apache/fop/afp/AFPResourceManagerTestCase.java
test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java
test/java/org/apache/fop/afp/goca/GraphicsCharacterStringTestCase.java
test/java/org/apache/fop/afp/modca/AbstractAFPObjectTest.java
test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTest.java
test/java/org/apache/fop/afp/modca/AbstractStructuredObjectTest.java
test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTest.java
test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java
test/java/org/apache/fop/afp/parser/MODCAParserTestCase.java
test/java/org/apache/fop/afp/ptoca/TransparentDataControlSequenceTestCase.java
test/java/org/apache/fop/apps/AbstractRendererConfigParserTester.java
test/java/org/apache/fop/apps/AbstractRendererConfiguratorTest.java
test/java/org/apache/fop/apps/EnvironmentalProfileFactoryTestCase.java
test/java/org/apache/fop/apps/FopFactoryBuilderTestCase.java
test/java/org/apache/fop/apps/FopFactoryTestCase.java
test/java/org/apache/fop/apps/PDFRendererConfBuilder.java
test/java/org/apache/fop/apps/io/BaseURIResolutionTest.java
test/java/org/apache/fop/apps/io/FontURIResolver.java
test/java/org/apache/fop/area/ViewportTest.java
test/java/org/apache/fop/area/ViewportTestSuite.java
test/java/org/apache/fop/area/inline/InlineViewportTestCase.java
test/java/org/apache/fop/check/ChecksFactory.java
test/java/org/apache/fop/cli/CommandLineOptionsTestCase.java
test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java
test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java
test/java/org/apache/fop/complexscripts/bidi/BidiTestData.java
test/java/org/apache/fop/complexscripts/fonts/GDEFTestCase.java
test/java/org/apache/fop/complexscripts/fonts/GPOSTestCase.java
test/java/org/apache/fop/complexscripts/fonts/GSUBTestCase.java
test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java
test/java/org/apache/fop/complexscripts/scripts/ScriptsTestSuite.java
test/java/org/apache/fop/complexscripts/scripts/arabic/ArabicTestCase.java
test/java/org/apache/fop/complexscripts/scripts/arabic/ArabicTestConstants.java
test/java/org/apache/fop/complexscripts/scripts/arabic/GenerateArabicTestData.java
test/java/org/apache/fop/complexscripts/util/NumberConverterTestCase.java
test/java/org/apache/fop/complexscripts/util/UtilTestSuite.java
test/java/org/apache/fop/config/FontAttributesMissingTestCase.java
test/java/org/apache/fop/config/FontMetricsUrlBadTestCase.java
test/java/org/apache/fop/config/FontMetricsUrlMalformedTestCase.java
test/java/org/apache/fop/config/FontTripletAttributeMissingTestCase.java
test/java/org/apache/fop/config/FontsAutoDetectTestCase.java
test/java/org/apache/fop/config/FontsDirectoryRecursiveTestCase.java
test/java/org/apache/fop/datatypes/URISpecificationTestCase.java
test/java/org/apache/fop/events/BasicEventTestCase.java
test/java/org/apache/fop/events/TestEventProducer.java
test/java/org/apache/fop/fo/DelegatingFOEventHandlerTestCase.java
test/java/org/apache/fop/fo/FODocumentParser.java
test/java/org/apache/fop/fo/FONodeMocks.java
test/java/org/apache/fop/fo/flow/MarkersTestCase.java
test/java/org/apache/fop/fo/flow/table/AbstractTableTest.java
test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java
test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java
test/java/org/apache/fop/fo/flow/table/TableColumnColumnNumberTestCase.java
test/java/org/apache/fop/fo/flow/table/TableHandler.java
test/java/org/apache/fop/fo/pagination/AllTests.java
test/java/org/apache/fop/fo/pagination/PageSequenceMasterTestCase.java
test/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternativesTestCase.java
test/java/org/apache/fop/fo/properties/AltTextHolderTestCase.java
test/java/org/apache/fop/fo/properties/CommonAccessibilityHolderTestCase.java
test/java/org/apache/fop/fonts/DejaVuLGCSerifTestCase.java
test/java/org/apache/fop/fonts/EmbedFontInfoTestCase.java
test/java/org/apache/fop/fonts/FontManagerConfiguratorTestCase.java
test/java/org/apache/fop/fonts/cff/CFFDataReaderTestCase.java
test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java
test/java/org/apache/fop/fonts/truetype/OTFFileTestCase.java
test/java/org/apache/fop/fonts/truetype/OTFSubSetFileTestCase.java
test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java
test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java
test/java/org/apache/fop/fonts/type1/AFMParserTestCase.java
test/java/org/apache/fop/fonts/type1/AdobeStandardEncodingTestCase.java
test/java/org/apache/fop/fonts/type1/CharMetricsHandlerTestCase.java
test/java/org/apache/fop/fotreetest/ext/AssertElement.java
test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java
test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java
test/java/org/apache/fop/image/loader/batik/ImagePreloaderTestCase.java
test/java/org/apache/fop/intermediate/AbstractIFTest.java
test/java/org/apache/fop/intermediate/AreaTreeXMLFormatTestSuite.java
test/java/org/apache/fop/intermediate/IFMimickingTestCase.java
test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java
test/java/org/apache/fop/intermediate/LayoutIFTestSuite.java
test/java/org/apache/fop/layoutengine/ElementListCheck.java
test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
test/java/org/apache/fop/layoutengine/LayoutResult.java
test/java/org/apache/fop/layoutmgr/table/TableCellLayoutManagerTestCase.java
test/java/org/apache/fop/logging/LoggingElementListObserver.java
test/java/org/apache/fop/memory/MemoryEater.java
test/java/org/apache/fop/pdf/AbstractPDFStreamTestCase.java
test/java/org/apache/fop/pdf/FileIDGeneratorTestCase.java
test/java/org/apache/fop/pdf/ObjectStreamManagerTestCase.java
test/java/org/apache/fop/pdf/ObjectStreamTestCase.java
test/java/org/apache/fop/pdf/PDFAModeTestCase.java
test/java/org/apache/fop/pdf/PDFArrayTestCase.java
test/java/org/apache/fop/pdf/PDFDestsTestCase.java
test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java
test/java/org/apache/fop/pdf/PDFDocumentGraphics2DTestCase.java
test/java/org/apache/fop/pdf/PDFDocumentTestCase.java
test/java/org/apache/fop/pdf/PDFEncodingTestCase.java
test/java/org/apache/fop/pdf/PDFEncryptionJCETestCase.java
test/java/org/apache/fop/pdf/PDFFilterListTestCase.java
test/java/org/apache/fop/pdf/PDFNameTestCase.java
test/java/org/apache/fop/pdf/PDFNullTestCase.java
test/java/org/apache/fop/pdf/PDFNumberTestCase.java
test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java
test/java/org/apache/fop/pdf/PDFObjectTestCase.java
test/java/org/apache/fop/pdf/PDFRectangleTestCase.java
test/java/org/apache/fop/pdf/PDFReferenceTestCase.java
test/java/org/apache/fop/pdf/PDFStreamTestCase.java
test/java/org/apache/fop/pdf/TableHeaderScopeTestCase.java
test/java/org/apache/fop/pdf/VersionControllerTestCase.java
test/java/org/apache/fop/pdf/VersionTestCase.java
test/java/org/apache/fop/pdf/xref/CompressedObjectReferenceTestCase.java
test/java/org/apache/fop/pdf/xref/CrossReferenceObjectTest.java
test/java/org/apache/fop/pdf/xref/UncompressedObjectReferenceTestCase.java
test/java/org/apache/fop/render/AbstractRenderingTest.java
test/java/org/apache/fop/render/RawPNGTestUtil.java
test/java/org/apache/fop/render/RendererFactoryTestCase.java
test/java/org/apache/fop/render/afp/AFPBorderPainterTestCase.java
test/java/org/apache/fop/render/afp/AFPRendererConfigParserTestCase.java
test/java/org/apache/fop/render/afp/AFPRendererConfiguratorTestCase.java
test/java/org/apache/fop/render/afp/NoOperationTestCase.java
test/java/org/apache/fop/render/bitmap/AbstractBitmapRendererConfigParserTester.java
test/java/org/apache/fop/render/bitmap/AbstractBitmapRendererConfiguratorTest.java
test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java
test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java
test/java/org/apache/fop/render/extensions/prepress/PageBoundariesTestCase.java
test/java/org/apache/fop/render/extensions/prepress/PageScaleTestCase.java
test/java/org/apache/fop/render/intermediate/AbstractIFPainterTestCase.java
test/java/org/apache/fop/render/intermediate/ArcToBezierCurveTransformerTestCase.java
test/java/org/apache/fop/render/intermediate/BorderPainterTestCase.java
test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java
test/java/org/apache/fop/render/intermediate/SAXEventRecorderTestCase.java
test/java/org/apache/fop/render/java2d/Java2DRendererConfigParserTestcase.java
test/java/org/apache/fop/render/pcl/PCLRendererConfigParserTestCase.java
test/java/org/apache/fop/render/pcl/PCLRendererConfiguratorTestCase.java
test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
test/java/org/apache/fop/render/pdf/PDFAMetadataTestCase.java
test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java
test/java/org/apache/fop/render/pdf/PDFEncodingTestCase.java
test/java/org/apache/fop/render/pdf/PDFGraphicsPainterTestCase.java
test/java/org/apache/fop/render/pdf/PDFPainterTestCase.java
test/java/org/apache/fop/render/pdf/PDFRendererConfigParserTestCase.java
test/java/org/apache/fop/render/pdf/PDFRendererOptionsConfigTestCase.java
test/java/org/apache/fop/render/pdf/PDFsRGBSettingsTestCase.java
test/java/org/apache/fop/render/pdf/RenderPDFTestSuite.java
test/java/org/apache/fop/render/ps/AbstractPostScriptTest.java
test/java/org/apache/fop/render/ps/ImageEncoderPNGTestCase.java
test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java
test/java/org/apache/fop/render/ps/PSPainterTestCase.java
test/java/org/apache/fop/render/ps/PSRendererConfigParserTestCase.java
test/java/org/apache/fop/render/ps/PSRendererConfiguratorTestCase.java
test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java
test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java
test/java/org/apache/fop/render/ps/svg/PSSVGGraphics2DTestCase.java
test/java/org/apache/fop/render/ps/svg/PSSVGLinearGraphics2DTestCase.java
test/java/org/apache/fop/render/rtf/Bug39607TestCase.java
test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/BasicLink.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/DummyTableColumnsInfo.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/ExternalGraphic.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/ListInTable.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/MergedTableCells.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/NestedTable.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/ParagraphAlignment.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleDocument.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleLists.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/SimpleTable.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/TestDocument.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/TextAttributes.java
test/java/org/apache/fop/render/rtf/rtflib/testdocs/Whitespace.java
test/java/org/apache/fop/render/txt/TxtRendererConfigParserTestCase.java
test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java
test/java/org/apache/fop/text/linebreak/LineBreakUtilsTestCase.java
test/java/org/apache/fop/threading/FOProcessorImpl.java
test/java/org/apache/fop/threading/Main.java
test/java/org/apache/fop/traits/BorderPropsTestCase.java
test/java/org/apache/fop/traits/MinOptMaxTestCase.java
test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java
test/java/org/apache/fop/util/BitmapImageUtilTestCase.java
test/java/org/apache/fop/util/ColorUtilTestCase.java
test/java/org/apache/fop/util/DigestFilter.java
test/java/org/apache/fop/util/ElementListUtilsTestCase.java
test/java/org/apache/fop/util/LanguageTagsTestCase.java
test/java/org/apache/fop/util/XMLResourceBundleTestCase.java
test/java/org/apache/fop/visual/BitmapComparator.java
test/java/org/apache/fop/visual/ConvertUtils.java

index f25239bc02ef66bd268bd3bd0ba26970f2897fb2..11e99ca1512ee00c3eb4c34cc78992001d97df87 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1074,6 +1074,7 @@ NOTE:
         <pathelement location="${build.codegen-classes.dir}"/>
       </classpath>
       <fileset dir="${src.dir}" includes="**/*.java"/>
+      <fileset dir="${test.dir}" includes="**/*.java"/>
       <formatter type="xml" toFile="${build.dir}/report_checkstyle.xml"/>
     </checkstyle>
     <xslt in="${build.dir}/report_checkstyle.xml" out="${build.dir}/report_checkstyle.html" style="${checkstyle.noframes.xslt}"/>
index 7dc583dbb5de567f07c8d028fc5d096c2ff0a6e9..050f5dab4b5ff6a19d4a38708b06f0d2bfa70b8a 100644 (file)
@@ -6,4 +6,7 @@
   <suppress files="org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java" checks="SimplifyBooleanReturn"/>
   <suppress files="org/apache/fop/complexscripts/scripts/ArabicScriptProcessor.java" checks="SimplifyBooleanReturn"/>
   <suppress files="org/apache/fop/complexscripts/util/CharScript.java" checks="SimplifyBooleanReturn"/>
+  <suppress files="org/apache/fop/render/rtf/rtflib/testdocs/MergedTableCells.java" checks="AvoidNestedBlocks"/>
+  <suppress files="org/apache/fop/render/rtf/rtflib/testdocs/NestedTable.java" checks="AvoidNestedBlocks"/>
+  <suppress files="org/apache/fop/fo/flow/MarkersTestCase.java" checks="LocalVariableName"/>
 </suppressions>
index 2087c8df275677063fd688ae05072757ca91012d..7a40b353a4995155dacfed6d50f550313fc38a41 100644 (file)
@@ -24,13 +24,15 @@ import java.io.InputStream;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.output.ByteArrayOutputStream;
+
 import org.apache.batik.transcoder.Transcoder;
 import org.apache.batik.transcoder.TranscoderInput;
 import org.apache.batik.transcoder.TranscoderOutput;
-import org.apache.commons.io.output.ByteArrayOutputStream;
 
 import static org.apache.fop.FOPTestUtils.getBaseDir;
-import static org.junit.Assert.assertTrue;
 
 /**
  * Basic runtime test for FOP's transcoders. It is used to verify that
index f149b451ee6f640e6be807b533a306d83f794f7e..e89a1c5588bedb8ab2740632fce8e9ec7a799887 100644 (file)
@@ -28,11 +28,13 @@ import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.stream.StreamSource;
 
-import org.apache.fop.apps.FOPException;
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
 import org.apache.commons.io.output.ByteArrayOutputStream;
 
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.Fop;
 import org.apache.fop.apps.FopFactory;
@@ -40,7 +42,6 @@ import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.cli.InputHandler;
 
 import static org.apache.fop.FOPTestUtils.getBaseDir;
-import static org.junit.Assert.assertTrue;
 
 /**
  * Basic runtime test for the old Fop class. It is used to verify that
@@ -136,7 +137,7 @@ public class BasicDriverTestCase {
         InputHandler handler = new InputHandler(xmlFile, xsltFile, null);
         try {
             handler.renderTo(foUserAgent, MimeConstants.MIME_PDF, baout);
-        } catch (FOPException e) {}
+        } catch (FOPException e) { /* NOP */ }
     }
 
 }
index 8330a5f7ff9415516cfe4a9fb40d5769dda78c82..68619926ae20eacb14a37f40f80d8299f6bc0cf2 100644 (file)
@@ -27,6 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * Test suite for basic functionality of FOP's Driver API.
  */
 @RunWith(Suite.class)
-@SuiteClasses({ BasicDriverTestCase.class })
+@SuiteClasses(BasicDriverTestCase.class)
 public class BasicDriverTestSuite {
 }
index f2f233a5a97c56c04c61c7b9edae294bb889cedd..2d6fc0d8152abc0a2dadec31f43c71acf7c4db6e 100644 (file)
@@ -20,6 +20,7 @@
 package org.apache.fop;
 
 import org.apache.batik.transcoder.Transcoder;
+
 import org.apache.fop.render.ps.PSTranscoder;
 
 /**
index 6705d2f560f76f8a181cc73ee3e3878c5e6d6ab4..9ee7de07284e4f87f9cb2e5c9c306c4d8b01ec38 100644 (file)
@@ -25,7 +25,10 @@ import org.apache.fop.logging.LoggingElementListObserver;
 /**
  * Handles some standard tasks for debugging.
  */
-public class DebugHelper {
+public final class DebugHelper {
+
+    private DebugHelper() {
+    }
 
     private static boolean elObserversRegistered = false;
 
index 5606c2b66ac9b3180d39385797ff11bbb94a47de..679b65aeef9cbee2f6de1f58b331c64ed2e168cd 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop;
 
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
 import java.io.StringReader;
 import java.security.NoSuchAlgorithmException;
@@ -28,13 +26,16 @@ import java.security.NoSuchAlgorithmException;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParserFactory;
 
-import org.apache.fop.util.DigestFilter;
 import org.junit.Before;
 import org.junit.Test;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 
+import static org.junit.Assert.assertTrue;
+
+import org.apache.fop.util.DigestFilter;
+
 /**
  * Test case for digesting SAX filter.
  *
index 18176117c4685ecd2bb964ce4ea5e6aab857225b..8f44864e0dc6c7201871ab0452001ad5782fb58d 100644 (file)
 
 package org.apache.fop;
 
-import static org.junit.Assert.assertEquals;
-
 import java.util.List;
 
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.layoutmgr.BlockKnuthSequence;
 import org.apache.fop.layoutmgr.BreakingAlgorithm;
 import org.apache.fop.layoutmgr.ElementListObserver;
@@ -30,8 +33,6 @@ import org.apache.fop.layoutmgr.KnuthBox;
 import org.apache.fop.layoutmgr.KnuthGlue;
 import org.apache.fop.layoutmgr.KnuthPenalty;
 import org.apache.fop.layoutmgr.KnuthSequence;
-import org.junit.Before;
-import org.junit.Test;
 
 /**
  * Tests the Knuth algorithm implementation.
index e1015306efe778bf844fc049e6f2a54e37e3b4ee..e01271f2b620fe279de061b0c7ab6d476eeb9da4 100644 (file)
@@ -41,6 +41,9 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.w3c.dom.Document;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.xpath.XPathAPI;
@@ -59,8 +62,6 @@ import org.apache.fop.apps.io.ResourceResolverFactory;
 import org.apache.fop.render.xml.XMLRenderer;
 
 import static org.apache.fop.FOPTestUtils.getBaseDir;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 /**
  * Tests URI resolution facilities.
index fc5f1825c88d725136f1aec89f50f86d6a084c2b..e9134a90b4d0ffc4120b4c7b68ea164ea22b07a1 100644 (file)
 
 package org.apache.fop.afp;
 
-import static org.junit.Assert.assertEquals;
-
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Test case for {@link AFPObjectAreaInfo}.
  */
index 47c93064cbcc23cee0df501b4b6790e643af2ce9..e9806f944dbb12b10e2a6e4f49772001cbac0a63 100644 (file)
 
 package org.apache.fop.afp;
 
-import static org.junit.Assert.assertEquals;
-
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Test case for {@link AFPPaintingState}.
  */
index 21540221fc03148ed72958375efb08dff1a4ecde..9d805a7dacfb7713d16d98eb4fac5d823312fbe1 100644 (file)
@@ -26,13 +26,13 @@ import java.io.IOException;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.xmlgraphics.util.MimeConstants;
 
 import org.apache.fop.apps.io.ResourceResolverFactory;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 /**
  * Test case for {@link AFPResourceManager}.
  */
index a7cf57ebe0f7c43cfd6cb3cf7b235c086e3d09ec..178e5c6ad39264c6e7c9ce729ca3106463a75d9e 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.afp;
 
-import static org.junit.Assert.assertTrue;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -29,11 +27,11 @@ import java.util.Arrays;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
 import org.apache.commons.io.IOUtils;
-import org.apache.fop.afp.util.AFPResourceUtil;
-import org.junit.Test;
 
-import static org.junit.Assert.assertTrue;
+import org.apache.fop.afp.util.AFPResourceUtil;
 
 /**
  * Tests the {@link AFPResourceUtil} class.
@@ -133,7 +131,7 @@ public class AFPResourceUtilTestCase {
      * names fails.
      * @throws Exception -
      */
-    @Test(expected=Exception.class)
+    @Test(expected = Exception.class)
     public void testResourceNameMismatch() throws Exception {
         testResource(RESOURCE_NAME_MISMATCH, PSEG_B);
     }
@@ -156,6 +154,6 @@ public class AFPResourceUtilTestCase {
     }
 
     private interface ResourceCopier {
-        public void copy(InputStream in, OutputStream out) throws IOException;
+        void copy(InputStream in, OutputStream out) throws IOException;
     }
 }
index b77ef6e128c87c9b6b7b9bd1c789c9cead77f9ab..17c47743ca1bf862d67ecc1b0ad468d41e87953b 100644 (file)
  */
 package org.apache.fop.afp.goca;
 
-import static org.junit.Assert.assertEquals;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.afp.fonts.CharacterSet;
 import org.apache.fop.afp.fonts.CharacterSetBuilder;
 import org.apache.fop.fonts.Typeface;
-import org.junit.Before;
-import org.junit.Test;
 
 public class GraphicsCharacterStringTestCase {
     private GraphicsCharacterString gcsCp500;
index 65c0224c257a57aad81a0cf48f735c66bfe2e5cc..a4c80cc65c9df4ca4567c1e8a8fccaefe46c2342 100644 (file)
 
 package org.apache.fop.afp.modca;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -30,9 +26,14 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.fop.afp.Streamable;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.fop.afp.Streamable;
+
 /**
  * Tests the {@link AbstractAFPObject} class.
  */
index 5c863b6e4f35d65e23883a8a7db7412b4cb33eff..0593ae637b6e0e07da7be474c38d13a692df4345 100644 (file)
 
 package org.apache.fop.afp.modca;
 
-import static org.junit.Assert.assertTrue;
-
 import java.util.Arrays;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests the {@linkplain AbstractAFPObject} class.
  */
index faef0a4f66d61c0b1ffefc613419ecb795fdf99c..d0a5430870a0d55bc153d0a2e478e5f182d132f3 100644 (file)
@@ -21,7 +21,8 @@ package org.apache.fop.afp.modca;
 
 import java.io.IOException;
 
-public abstract class AbstractStructuredObjectTest<S extends  AbstractStructuredObject> extends AbstractAFPObjectTest<S> {
+public abstract class AbstractStructuredObjectTest<S extends  AbstractStructuredObject>
+        extends AbstractAFPObjectTest<S> {
 
     /**
      * Test writeStart() - test that the contract is maintained with
index 10c15455039eb1435765810ce234a2fc26b894aa..fe25996bb3a07edd21f95f5e9eef58c2d53403cf 100644 (file)
 
 package org.apache.fop.afp.modca;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -33,6 +29,10 @@ import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.afp.modca.triplets.AbstractTriplet;
 import org.apache.fop.afp.modca.triplets.AttributeQualifierTriplet;
 import org.apache.fop.afp.modca.triplets.CommentTriplet;
index 0449f2599202af49d12134a59e48bf973df09c49..7e096f98b22afa681ef77bae2ea69531aa830459 100644 (file)
 
 package org.apache.fop.afp.modca;
 
-import static org.junit.Assert.assertTrue;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
 
-import org.apache.fop.afp.util.BinaryUtils;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
+import org.apache.fop.afp.util.BinaryUtils;
+
 /**
  * Test {@link IncludeObject}
  */
index c80ef086cc8bafdb030378958475d8efac7b1f7d..176344618c95c309c29c1e11b51e10f06b0c447c 100644 (file)
 
 package org.apache.fop.afp.parser;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.EOFException;
@@ -32,6 +27,11 @@ import java.util.Arrays;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 /**
  * MODCAParser and MODCAParser.UnparsedStructuredField Unit tests
  */
index 338c5e6f4b07831794a8c392edb5d9f171807833..8d6c79d0553f7ae7cafe370cfba04314630695d1 100644 (file)
@@ -24,15 +24,16 @@ import java.io.OutputStream;
 
 import org.junit.Test;
 
-import org.apache.fop.afp.fonts.CharactersetEncoder.EncodedChars;
-import org.apache.fop.afp.ptoca.TransparentDataControlSequence.TransparentData;
-
-import static org.apache.fop.afp.ptoca.PtocaConstants.TRANSPARENT_DATA_MAX_SIZE;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import org.apache.fop.afp.fonts.CharactersetEncoder.EncodedChars;
+import org.apache.fop.afp.ptoca.TransparentDataControlSequence.TransparentData;
+
+import static org.apache.fop.afp.ptoca.PtocaConstants.TRANSPARENT_DATA_MAX_SIZE;
+
 public class TransparentDataControlSequenceTestCase {
 
     private EncodedChars encodedChars;
index 9739db2f3e3edab55ddd16f10999c7fe8b12b5f4..e4c9ceb44f47a283a502e1f6dc310a5accda0792 100644 (file)
@@ -19,6 +19,9 @@
 
 package org.apache.fop.apps;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
 
@@ -28,9 +31,6 @@ import org.apache.fop.fonts.FontManager;
 import org.apache.fop.render.RendererConfig;
 import org.apache.fop.render.RendererConfig.RendererConfigParser;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 public abstract class AbstractRendererConfigParserTester<B extends RendererConfBuilder,
         C extends RendererConfig> {
 
index 58c14f5dfa31690ddd1fbae5ca540b8cd8603f4e..2487c0a6378290707d76919f06ef085d16640d7f 100644 (file)
@@ -24,16 +24,17 @@ import java.io.IOException;
 
 import org.xml.sax.SAXException;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import org.apache.avalon.framework.configuration.ConfigurationException;
 
 import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
 import org.apache.fop.render.PrintRendererConfigurator;
 import org.apache.fop.render.intermediate.IFDocumentHandler;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public abstract class AbstractRendererConfiguratorTest<T extends PrintRendererConfigurator, B extends RendererConfBuilder> {
+public abstract class AbstractRendererConfiguratorTest<T extends PrintRendererConfigurator,
+        B extends RendererConfBuilder> {
 
     protected final String mimeType;
     protected FOUserAgent userAgent;
index e94403e71103423eea04e7e7cb739c09fece06e2..83bfd20769116393a728a32fd01c2b058ce0d4bd 100644 (file)
@@ -21,7 +21,6 @@ import java.net.URI;
 
 import org.junit.Test;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 
index e504c4bc4c887c185a4b1c3bcb006aba0a281da4..86b4e7c04bc30e1399652be51006f2beea32ab8e 100644 (file)
@@ -27,6 +27,12 @@ import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import org.apache.fop.apps.io.ResourceResolverFactory;
 import org.apache.fop.area.AreaTreeHandler;
 import org.apache.fop.area.Block;
@@ -45,12 +51,6 @@ import org.apache.fop.layoutmgr.PageSequenceLayoutManager;
 import org.apache.fop.layoutmgr.StaticContentLayoutManager;
 import org.apache.fop.layoutmgr.inline.ContentLayoutManager;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 /**
  * Test case for {@link FopFactoryBuilder}.
  */
index 8ac21c99416a527e8c63455d655c481f8ca3fa4b..439ffa44e1c632d6ebaff73941971ab5993a0a03 100644 (file)
@@ -24,16 +24,15 @@ import java.io.IOException;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.config.BaseConstructiveUserConfigTest;
-import org.apache.fop.render.RendererConfig.RendererConfigParser;
-import org.apache.fop.render.pdf.PDFRendererConfig;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.apache.fop.config.BaseConstructiveUserConfigTest;
+import org.apache.fop.render.RendererConfig.RendererConfigParser;
+import org.apache.fop.render.pdf.PDFRendererConfig;
+
 public class FopFactoryTestCase extends BaseConstructiveUserConfigTest {
 
     public FopFactoryTestCase() throws SAXException, IOException {
index 13ca3df6b5ddd9ed4e9f668883145014ce881bbc..3da4e1daf0d9c60cc53e46b3ffeb7cf4a6cbc805 100644 (file)
@@ -22,10 +22,8 @@ package org.apache.fop.apps;
 import org.w3c.dom.Element;
 
 import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
-import org.apache.fop.pdf.PDFEncryptionParams;
 import org.apache.fop.render.RendererConfigOption;
 import org.apache.fop.render.pdf.PDFEncryptionOption;
-import org.apache.fop.render.pdf.PDFRendererOption;
 
 import static org.apache.fop.render.pdf.PDFEncryptionOption.ENCRYPTION_LENGTH;
 import static org.apache.fop.render.pdf.PDFEncryptionOption.ENCRYPTION_PARAMS;
index 2131407c10672c09cedf371907090b8cb32710ee..e04283718fb9cff7aed76b61cdd67a51b0ef0bfd 100644 (file)
@@ -34,6 +34,8 @@ import javax.xml.transform.stream.StreamSource;
 
 import org.xml.sax.SAXException;
 
+import static org.junit.Assert.assertTrue;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 
@@ -48,7 +50,6 @@ import org.apache.fop.apps.FopFactoryBuilder;
 import org.apache.fop.apps.MimeConstants;
 
 import static org.apache.fop.FOPTestUtils.getBaseDir;
-import static org.junit.Assert.assertTrue;
 
 public abstract class BaseURIResolutionTest {
 
index 40d6c7402a4394d046957d2a0f4f81c5e52b8521..781aca368e39fb8171bda4b468a58b86d1b19bfd 100644 (file)
@@ -33,14 +33,13 @@ import javax.xml.transform.TransformerException;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
-import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.apps.PDFRendererConfBuilder;
-
 import static org.junit.Assert.assertTrue;
 
 import org.apache.xmlgraphics.io.Resource;
 
+import org.apache.fop.apps.FopConfBuilder;
+import org.apache.fop.apps.PDFRendererConfBuilder;
+
 public class FontURIResolver extends BaseURIResolutionTest {
 
     public enum Event {
index cb2282071b5ffb791b7880ec90139691ef6fc698..46412c83dcdc8239be76b83a2af8ed04974d06fd 100644 (file)
 
 package org.apache.fop.area;
 
+import java.awt.Rectangle;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.awt.Rectangle;
-
 /**
  * Tests implementations of the {@linkplain Viewport} interface.
  */
index 065e07bf9b9dc68cafd082b9c2614f2ce4f14885..891f1d0810cfdf82d04d2254b2e4fda791bcc440 100644 (file)
 
 package org.apache.fop.area;
 
-import org.apache.fop.area.inline.InlineViewportTestCase;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
+import org.apache.fop.area.inline.InlineViewportTestCase;
+
 /**
  * A suite of all the tests relating to the {@linkplain Viewport} interface.
  */
index edcf99d14f117c4226772514f3532ef213add4af..cba5759cfccf4f2ee61c3904a65b44b734917b84 100644 (file)
 
 package org.apache.fop.area.inline;
 
-import org.apache.fop.area.ViewportTest;
 import org.junit.Test;
 
+import org.apache.fop.area.ViewportTest;
+
 /**
  * Tests the {@linkplain InlineViewport} class.
  */
index a493c09f29337de442188630381be7d73508c5b2..d77ce422dd83cd711c740286f13007f8964acb80 100644 (file)
@@ -37,7 +37,7 @@ public abstract class ChecksFactory<C extends Check> {
     /**
      * A factory to create a particular kind of check.
      */
-    protected static interface CheckFactory<C> {
+    protected interface CheckFactory<C> {
 
         /**
          * Creates a {@link Check} instance from the given XML element.
index 9a80fd964b6f9f4b3f945476cf4845fe176a5a48..1be3daa84b56618a5690c1c953ba7591f41632e1 100644 (file)
 
 package org.apache.fop.cli;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
 
-import org.apache.fop.apps.FOPException;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.fop.apps.FOPException;
+
 public class CommandLineOptionsTestCase {
 
     private final CommandLineOptions clo = new CommandLineOptions();
index f20e113c1da8224c98aa5c2f23460da6775a57ff..8ed1af217e8111209fae4856067e50d24f4d9e15 100644 (file)
 
 package org.apache.fop.complexscripts.bidi;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.fop.complexscripts.bidi.UnicodeBidiAlgorithm;
-
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * <p>Test case for Unicode Bidi Algorithm.</p>
- * @author Glenn Adams
  */
 public class BidiAlgorithmTestCase {
 
     /**
      * logging instance
      */
-    private static final Log log = LogFactory.getLog(BidiAlgorithmTestCase.class);                                      // CSOK: ConstantNameCheck
+    private static final Log log = LogFactory.getLog(BidiAlgorithmTestCase.class);
 
     /**
      * Concatenated array of <test-set,test-sequence> tuples
@@ -122,7 +119,7 @@ public class BidiAlgorithmTestCase {
                 }
                 if (includeSequence(testSet, testSequence)) {
                     includedSequences++;
-                    if (! excludeSequence(testSet, testSequence)) {
+                    if (!excludeSequence(testSet, testSequence)) {
                         if (testBidiAlgorithm(testSet, testSequence, la, ra, ta, bs)) {
                             passedSequences++;
                         }
@@ -151,7 +148,7 @@ public class BidiAlgorithmTestCase {
     }
 
     private boolean includeSequence(int testSet, int testSequence) {
-        if (! includeTestSet(testSet)) {
+        if (!includeTestSet(testSet)) {
             return false;
         } else {
             for (int i = 0, n = INCLUSIONS.length / 2; i < n; i++) {
@@ -196,7 +193,8 @@ public class BidiAlgorithmTestCase {
         return false;
     }
 
-    private boolean testBidiAlgorithm(int testSet, int testSequence, int[] la, int[] ra, int[] ta, int bs) throws Exception {
+    private boolean testBidiAlgorithm(int testSet, int testSequence, int[] la, int[] ra, int[] ta, int bs)
+            throws Exception {
         boolean passed = true;
         int n = la.length;
         if (ra.length != n) {
@@ -211,14 +209,14 @@ public class BidiAlgorithmTestCase {
             // LTR
             if ((bs & 2) != 0) {
                 int[] levels = UnicodeBidiAlgorithm.resolveLevels(null, ta, 0, new int [ n ], true);
-                if (! verifyResults(la, levels, ta, 0, testSet, testSequence)) {
+                if (!verifyResults(la, levels, ta, 0, testSet, testSequence)) {
                     passed = false;
                 }
             }
             // RTL
             if ((bs & 4) != 0) {
                 int[] levels = UnicodeBidiAlgorithm.resolveLevels(null, ta, 1, new int [ n ], true);
-                if (! verifyResults(la, levels, ta, 1, testSet, testSequence)) {
+                if (!verifyResults(la, levels, ta, 1, testSet, testSequence)) {
                     passed = false;
                 }
             }
index 10a84b856a8209738b8c23edd34a7d153063e9ac..f393e5b70aff880d0aea483aa490d2f371d6aeb9 100644 (file)
 
 package org.apache.fop.complexscripts.bidi;
 
-import org.apache.fop.complexscripts.bidi.BidiClass;
-import org.apache.fop.util.CharUtilities;
-
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import org.apache.fop.util.CharUtilities;
+
 public class BidiClassTestCase {
 
     @Test
@@ -46,8 +45,8 @@ public class BidiClassTestCase {
     private void testBidiClass(int[] da) throws Exception {
         int bc = da[0];
         for (int i = 1, n = da.length; i < n; i += 2) {
-            int s = da[i+0];
-            int e = da[i+1];
+            int s = da[i + 0];
+            int e = da[i + 1];
             for (int c = s; c < e; c++) {
                 int cbc = BidiClass.getBidiClass(c);
                 assertEquals("bad bidi class for CH(" + CharUtilities.format(c) + ")", bc, cbc);
index 6be0c1fa9f36ca3286cd2768bbe4ca28cb09b28f..49a5c9455f75788c68f64a0c674492122d167be6 100644 (file)
@@ -65,7 +65,7 @@ public final class BidiTestData {
             data = null;
         } finally {
             if (is != null) {
-                try { is.close(); } catch (Exception e) {}
+                try { is.close(); } catch (Exception e) { /* NOP */ }
             }
         }
         return data;
index af929d3a115a1a4d9dbd811808a8c7afc244b831..f1512903c555ed31c70df5bc869566f4f3308828 100644 (file)
@@ -21,21 +21,14 @@ package org.apache.fop.complexscripts.fonts;
 
 import java.io.File;
 
-import org.apache.fop.complexscripts.fonts.GlyphSubtable;
-import org.apache.fop.complexscripts.fonts.GlyphDefinitionSubtable;
-import org.apache.fop.complexscripts.fonts.GlyphDefinitionTable;
-import org.apache.fop.complexscripts.fonts.GlyphTable.LookupSpec;
-import org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable;
-import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
-import org.apache.fop.complexscripts.util.GlyphContextTester;
-import org.apache.fop.complexscripts.util.GlyphSequence;
-
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
+
 public class GDEFTestCase {
 
     private static String ttxFilesRoot = "test/resources/complexscripts";
index 270b567978689de50b9158a9b48fa1b6a1a169d1..cf63b4effc97c9c20e9e9f6ed87c6d3643ed2814 100644 (file)
 package org.apache.fop.complexscripts.fonts;
 
 import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.fop.complexscripts.fonts.GlyphSubtable;
-import org.apache.fop.complexscripts.fonts.GlyphPositioningSubtable;
-import org.apache.fop.complexscripts.fonts.GlyphPositioningTable;
-import org.apache.fop.complexscripts.fonts.GlyphTable.LookupSpec;
-import org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable;
-import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
-import org.apache.fop.complexscripts.util.GlyphContextTester;
-import org.apache.fop.complexscripts.util.GlyphSequence;
-import org.apache.fop.complexscripts.util.ScriptContextTester;
 
 import org.junit.Test;
 
@@ -40,6 +28,14 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable;
+import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
+import org.apache.fop.complexscripts.util.GlyphContextTester;
+import org.apache.fop.complexscripts.util.GlyphSequence;
+import org.apache.fop.complexscripts.util.ScriptContextTester;
+
+// CSOFF: LineLength
+
 public class GPOSTestCase implements ScriptContextTester, GlyphContextTester {
 
     private static String ttxFilesRoot = "test/resources/complexscripts";
index b235fa58c21152a38550b8a903bac919b7e476eb..3f23d9ab37f54a63cccb57b01b8ba20ed451e3f5 100644 (file)
@@ -21,18 +21,6 @@ package org.apache.fop.complexscripts.fonts;
 
 import java.io.File;
 import java.nio.IntBuffer;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.fop.complexscripts.fonts.GlyphSubtable;
-import org.apache.fop.complexscripts.fonts.GlyphSubstitutionSubtable;
-import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable;
-import org.apache.fop.complexscripts.fonts.GlyphTable.LookupSpec;
-import org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable;
-import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
-import org.apache.fop.complexscripts.util.GlyphContextTester;
-import org.apache.fop.complexscripts.util.GlyphSequence;
-import org.apache.fop.complexscripts.util.ScriptContextTester;
 
 import org.junit.Test;
 
@@ -41,6 +29,14 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable;
+import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
+import org.apache.fop.complexscripts.util.GlyphContextTester;
+import org.apache.fop.complexscripts.util.GlyphSequence;
+import org.apache.fop.complexscripts.util.ScriptContextTester;
+
+// CSOFF: LineLength
+
 public class GSUBTestCase implements ScriptContextTester, GlyphContextTester {
 
     private static String ttxFilesRoot = "test/resources/complexscripts";
index c106e65c8b810711ff70691747ee8e343f780200..178203ff6d72d154d9f9219bd51d50c49bc67e0b 100644 (file)
@@ -21,11 +21,9 @@ package org.apache.fop.complexscripts.fonts.ttx;
 
 import java.io.File;
 import java.io.IOException;
-
 import java.nio.IntBuffer;
-
-import java.util.Arrays;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -41,21 +39,23 @@ import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import org.apache.fop.complexscripts.fonts.GlyphClassTable;
 import org.apache.fop.complexscripts.fonts.GlyphCoverageTable;
-import org.apache.fop.complexscripts.fonts.GlyphDefinitionSubtable;
 import org.apache.fop.complexscripts.fonts.GlyphDefinitionTable;
 import org.apache.fop.complexscripts.fonts.GlyphMappingTable;
-import org.apache.fop.complexscripts.fonts.GlyphPositioningSubtable;
 import org.apache.fop.complexscripts.fonts.GlyphPositioningTable;
 import org.apache.fop.complexscripts.fonts.GlyphPositioningTable.Anchor;
 import org.apache.fop.complexscripts.fonts.GlyphPositioningTable.MarkAnchor;
 import org.apache.fop.complexscripts.fonts.GlyphPositioningTable.PairValues;
 import org.apache.fop.complexscripts.fonts.GlyphPositioningTable.Value;
-import org.apache.fop.complexscripts.fonts.GlyphSubstitutionSubtable;
 import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable;
 import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable.Ligature;
 import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable.LigatureSet;
@@ -66,11 +66,6 @@ import org.apache.fop.complexscripts.util.GlyphSequence;
 import org.apache.fop.complexscripts.util.UTF32;
 import org.apache.fop.util.CharUtilities;
 
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
 
 // CSOFF: LineLengthCheck
 
@@ -87,8 +82,6 @@ import org.xml.sax.helpers.DefaultHandler;
  * files directly in the FOP distribution. In such cases, <code>TTX</code> files are used
  * to distribute a subset of the complex script advanced table information contained in
  * certain font files to facilitate testing.
- *
- * @author Glenn Adams
  */
 public class TTXFile {
 
@@ -100,22 +93,22 @@ public class TTXFile {
     private static final String DEFAULT_LANGUAGE_TAG = "dflt";
 
     /** ttxfile cache */
-    private static Map<String,TTXFile> cache = new HashMap<String,TTXFile>();
+    private static Map<String, TTXFile> cache = new HashMap<String, TTXFile>();
 
     // transient parsing state
     private Locator locator;                                    // current document locator
     private Stack<String[]> elements;                           // stack of ttx elements being parsed
-    private Map<String,Integer> glyphIds;                       // map of glyph names to glyph identifiers
+    private Map<String, Integer> glyphIds;                       // map of glyph names to glyph identifiers
     private List<int[]> cmapEntries;                            // list of <charCode,glyphCode> pairs
     private Vector<int[]> hmtxEntries;                          // vector of <width,lsb> pairs
-    private Map<String,Integer> glyphClasses;                   // map of glyph names to glyph classes
-    private Map<String,Map<String,List<String>>> scripts;       // map of script tag to Map<language-tag,List<features-id>>>
-    private Map<String,List<String>> languages;                 // map of language tag to List<feature-id>
-    private Map<String,Object[]> features;                      // map of feature id to Object[2] : { feature-tag, List<lookup-id> }
+    private Map<String, Integer> glyphClasses;                   // map of glyph names to glyph classes
+    private Map<String, Map<String, List<String>>> scripts;       // map of script tag to Map<language-tag,List<features-id>>>
+    private Map<String, List<String>> languages;                 // map of language tag to List<feature-id>
+    private Map<String, Object[]> features;                      // map of feature id to Object[2] : { feature-tag, List<lookup-id> }
     private List<String> languageFeatures;                      // list of language system feature ids, where first is (possibly null) required feature id
     private List<String> featureLookups;                        // list of lookup ids for feature being constructed
     private List<Integer> coverageEntries;                      // list of entries for coverage table being constructed
-    private Map<String,GlyphCoverageTable> coverages;           // map of coverage table keys to coverage tables
+    private Map<String, GlyphCoverageTable> coverages;           // map of coverage table keys to coverage tables
     private List subtableEntries;                               // list of lookup subtable entries
     private List<GlyphSubtable> subtables;                      // list of constructed subtables
     private List<Integer> alternates;                           // list of alternates in alternate set being constructed
@@ -162,8 +155,8 @@ public class TTXFile {
 
     // resultant state
     private int upem;                                           // units per em
-    private Map<Integer,Integer> cmap;                          // constructed character map
-    private Map<Integer,Integer> gmap;                          // constructed glyph map
+    private Map<Integer, Integer> cmap;                          // constructed character map
+    private Map<Integer, Integer> gmap;                          // constructed glyph map
     private int[][] hmtx;                                       // constructed horizontal metrics - array of design { width, lsb } pairs, indexed by glyph code
     private int[] widths;                                       // pdf normalized widths (millipoints)
     private GlyphDefinitionTable gdef;                          // constructed glyph definition table
@@ -172,17 +165,17 @@ public class TTXFile {
 
     public TTXFile() {
         elements = new Stack<String[]>();
-        glyphIds = new HashMap<String,Integer>();
+        glyphIds = new HashMap<String, Integer>();
         cmapEntries = new ArrayList<int[]>();
         hmtxEntries = new Vector<int[]>();
-        glyphClasses = new HashMap<String,Integer>();
-        scripts = new HashMap<String,Map<String,List<String>>>();
-        languages = new HashMap<String,List<String>>();
-        features = new HashMap<String,Object[]>();
+        glyphClasses = new HashMap<String, Integer>();
+        scripts = new HashMap<String, Map<String, List<String>>>();
+        languages = new HashMap<String, List<String>>();
+        features = new HashMap<String, Object[]>();
         languageFeatures = new ArrayList<String>();
         featureLookups = new ArrayList<String>();
         coverageEntries = new ArrayList<Integer>();
-        coverages = new HashMap<String,GlyphCoverageTable>();
+        coverages = new HashMap<String, GlyphCoverageTable>();
         subtableEntries = new ArrayList();
         subtables = new ArrayList<GlyphSubtable>();
         alternates = new ArrayList<Integer>();
@@ -342,7 +335,7 @@ public class TTXFile {
             long rest1 = tw % upem;
             long storrest = 1000 * rest1;
             long ledd2 = (storrest != 0) ? (rest1 / storrest) : 0;
-            pw = - ((-1000 * tw) / upem - (int) ledd2);
+            pw = -((-1000 * tw) / upem - (int) ledd2);
         } else {
             pw = (tw / upem) * 1000 + ((tw % upem) * 1000) / upem;
         }
@@ -370,7 +363,7 @@ public class TTXFile {
     public static synchronized void clearCache() {
         cache.clear();
     }
-    private class Handler extends DefaultHandler {
+    private final class Handler extends DefaultHandler {
         private Handler() {
         }
         @Override
@@ -493,7 +486,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("BaseArray")) {
                 String[] pn = new String[] { null, "MarkBasePos" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("BaseCoverage")) {
@@ -587,7 +580,7 @@ public class TTXFile {
                     if (glyphClass == null) {
                         missingRequiredAttribute(en, "class");
                     }
-                    if (! glyphIds.containsKey(glyph)) {
+                    if (!glyphIds.containsKey(glyph)) {
                         unsupportedGlyph(en, glyph);
                     } else if (isParent(pn1)) {
                         if (glyphClasses.containsKey(glyph)) {
@@ -675,7 +668,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("DefaultLangSys")) {
                 String[] pn = new String[] { null, "Script" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 } else {
                     assertLanguageFeaturesClear();
@@ -718,7 +711,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("Feature")) {
                 String[] pn = new String[] { null, "FeatureRecord" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 } else {
                     assertFeatureLookupsClear();
@@ -752,7 +745,7 @@ public class TTXFile {
                 String[] pn1 = new String[] { null, "GSUB" };
                 String[] pn2 = new String[] { null, "GPOS" };
                 String[][] pnx = new String[][] { pn1, pn2 };
-                if (! isParent(pnx)) {
+                if (!isParent(pnx)) {
                     notPermittedInElementContext(en, getParent(), pnx);
                 }
             } else if (en[1].equals("FeatureRecord")) {
@@ -885,7 +878,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("GlyphOrder")) {
                 String[] pn = new String[] { null, "ttFont" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("InputCoverage")) {
@@ -923,7 +916,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("LangSys")) {
                 String[] pn = new String[] { null, "LangSysRecord" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 } else {
                     assertLanguageFeaturesClear();
@@ -953,7 +946,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("LigCaretList")) {
                 String[] pn = new String[] { null, "GDEF" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("Ligature")) {
@@ -991,7 +984,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("LigatureArray")) {
                 String[] pn = new String[] { null, "MarkLigPos" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("LigatureAttach")) {
@@ -1139,7 +1132,7 @@ public class TTXFile {
                 String[] pn1 = new String[] { null, "GSUB" };
                 String[] pn2 = new String[] { null, "GPOS" };
                 String[][] pnx = new String[][] { pn1, pn2 };
-                if (! isParent(pnx)) {
+                if (!isParent(pnx)) {
                     notPermittedInElementContext(en, getParent(), pnx);
                 }
             } else if (en[1].equals("LookupListIndex")) {
@@ -1179,7 +1172,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("Mark1Array")) {
                 String[] pn = new String[] { null, "MarkMarkPos" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("Mark1Coverage")) {
@@ -1220,7 +1213,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("Mark2Array")) {
                 String[] pn = new String[] { null, "MarkMarkPos" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("Mark2Coverage")) {
@@ -1273,7 +1266,7 @@ public class TTXFile {
                 String[] pn1 = new String[] { null, "MarkBasePos" };
                 String[] pn2 = new String[] { null, "MarkLigPos" };
                 String[][] pnx = new String[][] { pn1, pn2 };
-                if (! isParent(pnx)) {
+                if (!isParent(pnx)) {
                     notPermittedInElementContext(en, getParent(), pnx);
                 }
             } else if (en[1].equals("MarkAttachClassDef")) {
@@ -1549,14 +1542,14 @@ public class TTXFile {
                 }
             } else if (en[1].equals("Script")) {
                 String[] pn = new String[] { null, "ScriptRecord" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("ScriptList")) {
                 String[] pn1 = new String[] { null, "GSUB" };
                 String[] pn2 = new String[] { null, "GPOS" };
                 String[][] pnx = new String[][] { pn1, pn2 };
-                if (! isParent(pnx)) {
+                if (!isParent(pnx)) {
                     notPermittedInElementContext(en, getParent(), pnx);
                 }
             } else if (en[1].equals("ScriptRecord")) {
@@ -1890,7 +1883,7 @@ public class TTXFile {
                 }
             } else if (en[1].equals("cmap")) {
                 String[] pn = new String[] { null, "ttFont" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("cmap_format_0")) {
@@ -1997,12 +1990,12 @@ public class TTXFile {
                 }
             } else if (en[1].equals("head")) {
                 String[] pn = new String[] { null, "ttFont" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 }
             } else if (en[1].equals("hmtx")) {
                 String[] pn = new String[] { null, "ttFont" };
-                if (! isParent(pn)) {
+                if (!isParent(pn)) {
                     notPermittedInElementContext(en, getParent(), pn);
                 } else if (glyphIdMax > 0) {
                     hmtxEntries.setSize(glyphIdMax + 1);
@@ -2216,7 +2209,7 @@ public class TTXFile {
                 throw new SAXException("element stack is empty, elements are not balanced");
             }
             String[] en = makeExpandedName(uri, localName, qName);
-            if (! sameExpandedName(enParent, en)) {
+            if (!sameExpandedName(enParent, en)) {
                 throw new SAXException("element stack is unbalanced, expanded name mismatch");
             }
             if (en[0] != null) {
@@ -2244,7 +2237,7 @@ public class TTXFile {
             } else if (en[1].equals("AlternateSet")) {
                 subtableEntries.add(extractAlternates());
             } else if (en[1].equals("AlternateSubst")) {
-                if (! sortEntries(coverageEntries, subtableEntries)) {
+                if (!sortEntries(coverageEntries, subtableEntries)) {
                     mismatchedEntries(en, coverageEntries.size(), subtableEntries.size());
                 }
                 addGSUBSubtable(GlyphSubstitutionTable.GSUB_LOOKUP_TYPE_ALTERNATE, extractCoverage());
@@ -2262,9 +2255,9 @@ public class TTXFile {
             } else if (en[1].equals("ChainContextPos") || en[1].equals("ChainContextSubst")) {
                 GlyphCoverageTable coverage = null;
                 if (stFormat == 3) {
-                    GlyphCoverageTable igca[] = getCoveragesWithPrefix("in");
-                    GlyphCoverageTable bgca[] = getCoveragesWithPrefix("bk");
-                    GlyphCoverageTable lgca[] = getCoveragesWithPrefix("la");
+                    GlyphCoverageTable[] igca = getCoveragesWithPrefix("in");
+                    GlyphCoverageTable[] bgca = getCoveragesWithPrefix("bk");
+                    GlyphCoverageTable[] lgca = getCoveragesWithPrefix("la");
                     if ((igca.length == 0) || hasMissingCoverage(igca)) {
                         missingCoverage(en, "input", igca.length);
                     } else if (hasMissingCoverage(bgca)) {
@@ -2363,7 +2356,7 @@ public class TTXFile {
             } else if (en[1].equals("LigatureSet")) {
                 subtableEntries.add(extractLigatures());
             } else if (en[1].equals("LigatureSubst")) {
-                if (! sortEntries(coverageEntries, subtableEntries)) {
+                if (!sortEntries(coverageEntries, subtableEntries)) {
                     mismatchedEntries(en, coverageEntries.size(), subtableEntries.size());
                 }
                 GlyphCoverageTable coverage = extractCoverage();
@@ -2475,7 +2468,8 @@ public class TTXFile {
                 }
                 GlyphCoverageTable coverage = coverages.get("main");
                 addGPOSSubtable(GlyphPositioningTable.GPOS_LOOKUP_TYPE_PAIR, coverage);
-                vf1 = vf2 = -1; psIndex = -1;
+                vf1 = vf2 = -1;
+                psIndex = -1;
             } else if (en[1].equals("PairSet")) {
                 if (psIndex != pairSets.size()) {
                     invalidIndex(en, psIndex, pairSets.size());
@@ -2528,7 +2522,7 @@ public class TTXFile {
                 addGPOSSubtable(GlyphPositioningTable.GPOS_LOOKUP_TYPE_SINGLE, coverage);
                 vf1 = -1;
             } else if (en[1].equals("SingleSubst")) {
-                if (! sortEntries(coverageEntries, subtableEntries)) {
+                if (!sortEntries(coverageEntries, subtableEntries)) {
                     mismatchedEntries(en, coverageEntries.size(), subtableEntries.size());
                 }
                 GlyphCoverageTable coverage = extractCoverage();
@@ -2556,7 +2550,7 @@ public class TTXFile {
         public void characters(char[] chars, int start, int length) {
         }
         private String[] getParent() {
-            if (! elements.empty()) {
+            if (!elements.empty()) {
                 return elements.peek();
             } else {
                 return new String[] { null, null };
@@ -2572,13 +2566,11 @@ public class TTXFile {
                 return false;
             } else if (enx instanceof String[]) {
                 String[] en = (String[]) enx;
-                if (! elements.empty()) {
+                if (!elements.empty()) {
                     String[] pn = elements.peek();
                     return (pn != null) && sameExpandedName(en, pn);
-                } else if ((en[0] == null) && (en[1] == null)) {
-                    return true;
                 } else {
-                    return false;
+                    return ((en[0] == null) && (en[1] == null));
                 }
             } else {
                 return false;
@@ -2595,14 +2587,12 @@ public class TTXFile {
                 return true;
             } else if (ln.equals("MarkAnchor")) {
                 return true;
-            } else if (ln.equals("Mark2Anchor")) {
-                return true;
             } else {
-                return false;
+                return ln.equals("Mark2Anchor");
             }
         }
-        private Map<Integer,Integer> getCMAP() {
-            Map<Integer,Integer> cmap = new TreeMap();
+        private Map<Integer, Integer> getCMAP() {
+            Map<Integer, Integer> cmap = new TreeMap();
             for (int[] cme : cmapEntries) {
                 Integer c = Integer.valueOf(cme[0]);
                 Integer g = Integer.valueOf(cme[1]);
@@ -2610,8 +2600,8 @@ public class TTXFile {
             }
             return cmap;
         }
-        private Map<Integer,Integer> getGMAP() {
-            Map<Integer,Integer> gmap = new TreeMap();
+        private Map<Integer, Integer> getGMAP() {
+            Map<Integer, Integer> gmap = new TreeMap();
             for (int[] cme : cmapEntries) {
                 Integer c = Integer.valueOf(cme[0]);
                 Integer g = Integer.valueOf(cme[1]);
@@ -2631,7 +2621,7 @@ public class TTXFile {
             }
             return hmtx;
         }
-        private GlyphClassTable extractClassDefMapping(Map<String,Integer> glyphClasses, int format, boolean clearSourceMap) {
+        private GlyphClassTable extractClassDefMapping(Map<String, Integer> glyphClasses, int format, boolean clearSourceMap) {
             GlyphClassTable ct;
             if (format == 1) {
                 ct = extractClassDefMapping1(extractClassMappings(glyphClasses, clearSourceMap));
@@ -2685,11 +2675,11 @@ public class TTXFile {
             }
             return GlyphClassTable.createClassTable(entries);
         }
-        private int[][] extractClassMappings(Map<String,Integer> glyphClasses, boolean clearSourceMap) {
+        private int[][] extractClassMappings(Map<String, Integer> glyphClasses, boolean clearSourceMap) {
             int nc = glyphClasses.size();
             int i = 0;
             int[][] cma = new int [ nc ] [ 2 ];
-            for (Map.Entry<String,Integer> e : glyphClasses.entrySet()) {
+            for (Map.Entry<String, Integer> e : glyphClasses.entrySet()) {
                 Integer gid = glyphIds.get(e.getKey());
                 assert gid != null;
                 int[] m = cma [ i ];
@@ -2856,8 +2846,8 @@ public class TTXFile {
         private void clearLanguageFeatures() {
             languageFeatures.clear();
         }
-        private Map<String,List<String>> extractLanguages() {
-            Map<String,List<String>> lm = new HashMap(languages);
+        private Map<String, List<String>> extractLanguages() {
+            Map<String, List<String>> lm = new HashMap(languages);
             clearLanguages();
             return lm;
         }
@@ -2923,10 +2913,10 @@ public class TTXFile {
             ltFlags = 0;
             clearSubtablesInLookup();
         }
-        private Map<GlyphTable.LookupSpec,List<String>> extractLookups() {
-            Map<GlyphTable.LookupSpec,List<String>> lookups = new LinkedHashMap<GlyphTable.LookupSpec,List<String>>();
+        private Map<GlyphTable.LookupSpec, List<String>> extractLookups() {
+            Map<GlyphTable.LookupSpec, List<String>> lookups = new LinkedHashMap<GlyphTable.LookupSpec, List<String>>();
             for (String st : scripts.keySet()) {
-                Map<String,List<String>> lm = scripts.get(st);
+                Map<String, List<String>> lm = scripts.get(st);
                 if (lm != null) {
                     for (String lt : lm.keySet()) {
                         List<String> fids = lm.get(lt);
@@ -3062,7 +3052,7 @@ public class TTXFile {
                 missingParameter(en, "xAdvance");
             }
             String yAdvance = attrs.getValue("YAdvance");
-            int ya = 0;;
+            int ya = 0;
             if (yAdvance != null) {
                 ya = Integer.parseInt(yAdvance);
             } else if ((format & GlyphPositioningTable.Value.Y_ADVANCE) != 0) {
@@ -3207,7 +3197,7 @@ public class TTXFile {
                     if (cm != null) {
                         for (Anchor[] aa : cm) {
                             if (aa != null) {
-                                int nc = aa.length;;
+                                int nc = aa.length;
                                 if (nc > ncMax) {
                                     ncMax = nc;
                                 }
@@ -3223,7 +3213,7 @@ public class TTXFile {
             if (lam != null) {
                 for (Anchor[][] cm : lam) {
                     if (cm != null) {
-                        int nx = cm.length;;
+                        int nx = cm.length;
                         if (nx > nxMax) {
                             nxMax = nx;
                         }
@@ -3424,7 +3414,7 @@ public class TTXFile {
             return false;
         }
         if ((u1 != null) && (u2 != null)) {
-            if (! u1.equals(u2)) {
+            if (!u1.equals(u2)) {
                 return false;
             }
         }
@@ -3434,7 +3424,7 @@ public class TTXFile {
             return false;
         }
         if ((l1 != null) && (l2 != null)) {
-            if (! l1.equals(l2)) {
+            if (!l1.equals(l2)) {
                 return false;
             }
         }
index cf5d846b4c374d66cb353591e6c7a8ddd64820b9..c48be5220e8d44a391f4775150c91b95a3e598b8 100644 (file)
@@ -29,8 +29,6 @@ import org.apache.fop.complexscripts.scripts.arabic.ArabicTestCase;
  * Test suite for script specific functionality related to complex scripts.
  */
 @RunWith(Suite.class)
-@SuiteClasses({
-    ArabicTestCase.class
-})
+@SuiteClasses(ArabicTestCase.class)
 public class ScriptsTestSuite {
 }
index d34e88a03cfa531d26d6d3a58b7b1bbf93ae90c1..8542faae90232c9f32cfec3cbe1bad34a555ba88 100644 (file)
@@ -21,30 +21,26 @@ package org.apache.fop.complexscripts.scripts.arabic;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FilenameFilter;
 import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
+import java.io.FilenameFilter;
 import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
 import java.io.ObjectInputStream;
 import java.nio.IntBuffer;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.fop.complexscripts.fonts.GlyphPositioningTable;
-import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable;
-import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
-import org.apache.fop.complexscripts.util.GlyphSequence;
-
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.fop.complexscripts.fonts.GlyphPositioningTable;
+import org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable;
+import org.apache.fop.complexscripts.fonts.ttx.TTXFile;
+import org.apache.fop.complexscripts.util.GlyphSequence;
+
+// CSOFF: LineLength
+
 /**
  * Tests for functionality related to the arabic script.
  */
@@ -52,9 +48,9 @@ public class ArabicTestCase implements ArabicTestConstants {
 
     @Test
     public void testArabicWordForms() {
-        for (String sfn : srcFiles) {
+        for (String sfn : SRC_FILES) {
             try {
-                processWordForms(new File(datFilesDir));
+                processWordForms(new File(DAT_FILES_DIR));
             } catch (Exception e) {
                 fail(e.getMessage());
             }
@@ -72,7 +68,7 @@ public class ArabicTestCase implements ArabicTestConstants {
     private String[] listWordFormFiles(File dfd) {
         return dfd.list(new FilenameFilter() {
                 public boolean accept(File f, String name) {
-                    return hasPrefixFrom(name, srcFiles) && hasExtension(name, WF_FILE_DAT_EXT);
+                    return hasPrefixFrom(name, SRC_FILES) && hasExtension(name, WF_FILE_DAT_EXT);
                 }
                 private boolean hasPrefixFrom(String name, String[] prefixes) {
                     for (String p : prefixes) {
@@ -108,7 +104,7 @@ public class ArabicTestCase implements ArabicTestConstants {
             throw new RuntimeException(e.getMessage(), e);
         } finally {
             if (fis != null) {
-                try { fis.close(); } catch (Exception e) {}
+                try { fis.close(); } catch (Exception e) { /* NOP */ }
             }
         }
     }
@@ -129,7 +125,7 @@ public class ArabicTestCase implements ArabicTestConstants {
                 script = (String) d[0];
                 language = (String) d[1];
                 tfn = (String) d[3];
-                tf = TTXFile.getFromCache(ttxFontsDir + File.separator + tfn);
+                tf = TTXFile.getFromCache(TTX_FONTS_DIR + File.separator + tfn);
                 assertTrue(tf != null);
                 gsub = tf.getGSUB();
                 assertTrue(gsub != null);
index 0669ff13707de700cbfc716c4a5021cce0c2a2a8..cc91675531730c4622508933f0da75cbbde254d4 100644 (file)
@@ -24,22 +24,22 @@ package org.apache.fop.complexscripts.scripts.arabic;
  */
 public interface ArabicTestConstants {
 
-    final String WF_FILE_SCRIPT = "arab";
-    final String WF_FILE_LANGUAGE = "dflt";
+    String WF_FILE_SCRIPT = "arab";
+    String WF_FILE_LANGUAGE = "dflt";
 
-    String srcFilesDir = "test/resources/complexscripts/arab/data";
-    String datFilesDir = "test/resources/complexscripts/arab/data";
+    String SRC_FILES_DIR = "test/resources/complexscripts/arab/data";
+    String DAT_FILES_DIR = "test/resources/complexscripts/arab/data";
 
-    String[] srcFiles = {
+    String[] SRC_FILES = {
         "arab-001",     // unpointed word forms
     };
 
-    final String WF_FILE_SRC_EXT = "txt";
-    final String WF_FILE_DAT_EXT = "ser";
+    String WF_FILE_SRC_EXT = "txt";
+    String WF_FILE_DAT_EXT = "ser";
 
-    String ttxFontsDir = "test/resources/complexscripts/arab/ttx";
+    String TTX_FONTS_DIR = "test/resources/complexscripts/arab/ttx";
 
-    String[] ttxFonts = {
+    String[] TTX_FONTS = {
         "arab-001.ttx", // simplified arabic
         "arab-002.ttx", // traditional arabic
         "arab-003.ttx", // lateef
index a4f876dd8c5881066f60158c55aa7fbd3f8a564e..9ca16a164462d780fd7f44515fdd891f27d99866 100644 (file)
@@ -40,7 +40,10 @@ import org.apache.fop.complexscripts.util.GlyphSequence;
 /**
  * Tests for functionality related to the arabic script.
  */
-public class GenerateArabicTestData implements ArabicTestConstants {
+public final class GenerateArabicTestData implements ArabicTestConstants {
+
+    private GenerateArabicTestData() {
+    }
 
     public static void main(String[] args) {
         boolean compile = false;
@@ -69,9 +72,9 @@ public class GenerateArabicTestData implements ArabicTestConstants {
     }
 
     private static void compile() {
-        for (String sfn : srcFiles) {
+        for (String sfn : SRC_FILES) {
             try {
-                String spn = srcFilesDir + File.separator + sfn + "." + WF_FILE_SRC_EXT;
+                String spn = SRC_FILES_DIR + File.separator + sfn + "." + WF_FILE_SRC_EXT;
                 compile(WF_FILE_SCRIPT, WF_FILE_LANGUAGE, spn);
             } catch (Exception e) {
                 System.err.println(e.getMessage());
@@ -81,8 +84,8 @@ public class GenerateArabicTestData implements ArabicTestConstants {
 
     private static void compile(String script, String language, String spn) {
         int fno = 0;
-        for (String tfn : ttxFonts) {
-            TTXFile tf = TTXFile.getFromCache(ttxFontsDir + File.separator + tfn);
+        for (String tfn : TTX_FONTS) {
+            TTXFile tf = TTXFile.getFromCache(TTX_FONTS_DIR + File.separator + tfn);
             assert tf != null;
             List data = compile(script, language, spn, tfn, tf);
             output(makeDataPathName(spn, fno++), data);
@@ -106,7 +109,7 @@ public class GenerateArabicTestData implements ArabicTestConstants {
                         GlyphSequence igs = tf.mapCharsToGlyphs(wf);
                         GlyphSequence ogs = gsub.substitute(igs, script, language);
                         int[][] paa = new int [ ogs.getGlyphCount() ] [ 4 ];
-                        if (! gpos.position(ogs, script, language, 1000, widths, paa)) {
+                        if (!gpos.position(ogs, script, language, 1000, widths, paa)) {
                             paa = null;
                         }
                         data.add(new Object[] { wf, getGlyphs(igs), getGlyphs(ogs), paa });
@@ -121,7 +124,7 @@ public class GenerateArabicTestData implements ArabicTestConstants {
                 throw new RuntimeException(e.getMessage(), e);
             } finally {
                 if (fis != null) {
-                    try { fis.close(); } catch (Exception e) {}
+                    try { fis.close(); } catch (Exception e) { /* NOP */ }
                 }
             }
         } else {
@@ -142,7 +145,7 @@ public class GenerateArabicTestData implements ArabicTestConstants {
 
     private static String makeDataPathName(String spn, int fno) {
         File f = new File(spn);
-        return datFilesDir + File.separator + stripExtension(f.getName()) + "-f" + fno + "." + WF_FILE_DAT_EXT;
+        return DAT_FILES_DIR + File.separator + stripExtension(f.getName()) + "-f" + fno + "." + WF_FILE_DAT_EXT;
     }
 
     private static String stripExtension(String s) {
@@ -171,7 +174,7 @@ public class GenerateArabicTestData implements ArabicTestConstants {
             throw new RuntimeException(e.getMessage(), e);
         } finally {
             if (fos != null) {
-                try { fos.close(); } catch (Exception e) {}
+                try { fos.close(); } catch (Exception e) { /* NOP */ }
             }
         }
     }
index ea885b6c5fd1fd20ca90d2bc5508bc4ed5146678..4e1db5fb35057ad87c9ba7305b3ad0cc19ac40f5 100644 (file)
@@ -30,12 +30,10 @@ import static org.junit.Assert.assertEquals;
 
 /**
  * Test number converter functionality.
- *
- * @author Glenn Adams
  */
 public class NumberConverterTestCase {
 
-    static private String[][] formatDecimal =
+    private static String[][] formatDecimal =
     {
         { "1" },
         { "0", "0" },
@@ -45,7 +43,7 @@ public class NumberConverterTestCase {
         { "1000000000", "1000000000" },
     };
 
-    static private String[][] formatDecimalPadded =
+    private static String[][] formatDecimalPadded =
     {
         { "001" },
         { "0", "000" },
@@ -58,7 +56,7 @@ public class NumberConverterTestCase {
         { "1000", "1000" },
     };
 
-    static private String[][] formatDecimalGrouped =
+    private static String[][] formatDecimalGrouped =
     {
         { "1", ",", "1" },
         { "0", "0" },
@@ -68,7 +66,7 @@ public class NumberConverterTestCase {
         { "1000000000", "1,0,0,0,0,0,0,0,0,0" },
     };
 
-    static private String[][] formatDecimalGroupedPadded =
+    private static String[][] formatDecimalGroupedPadded =
     {
         { "001", ",", "2" },
         { "0", "0,00" },
@@ -81,7 +79,7 @@ public class NumberConverterTestCase {
         { "1000", "10,00" },
     };
 
-    static private String[][] formatDecimalArabic =
+    private static String[][] formatDecimalArabic =
     {
         { "\u0661" },
         { "0", "\u0660" },
@@ -100,7 +98,7 @@ public class NumberConverterTestCase {
         { "1000000000", "\u0661\u0660\u0660\u0660\u0660\u0660\u0660\u0660\u0660\u0660" },
     };
 
-    static private String[][] formatDecimalArabicPadded =
+    private static String[][] formatDecimalArabicPadded =
     {
         { "\u0660\u0660\u0661" },
         { "0", "\u0660\u0660\u0660" },
@@ -113,7 +111,7 @@ public class NumberConverterTestCase {
         { "1000", "\u0661\u0660\u0660\u0660" },
     };
 
-    static private String[][] formatDecimalArabicGrouped =
+    private static String[][] formatDecimalArabicGrouped =
     {
         { "\u0661", "\u066c", "1" },
         { "0", "\u0660" },
@@ -123,7 +121,7 @@ public class NumberConverterTestCase {
         { "1000000000", "\u0661\u066c\u0660\u066c\u0660\u066c\u0660\u066c\u0660\u066c\u0660\u066c\u0660\u066c\u0660\u066c\u0660\u066c\u0660" },
     };
 
-    static private String[][] formatDecimalArabicGroupedPadded =
+    private static String[][] formatDecimalArabicGroupedPadded =
     {
         { "\u0660\u0660\u0661", "\u066c", "2" },
         { "0", "\u0660\u066c\u0660\u0660" },
@@ -136,7 +134,7 @@ public class NumberConverterTestCase {
         { "1000", "\u0661\u0660\u066c\u0660\u0660" },
     };
 
-    static private String[][] formatDecimalThai =
+    private static String[][] formatDecimalThai =
     {
         { "\u0E51" },
         { "0", "\u0E50" },
@@ -155,7 +153,7 @@ public class NumberConverterTestCase {
         { "1000000000", "\u0E51\u0E50\u0E50\u0E50\u0E50\u0E50\u0E50\u0E50\u0E50\u0E50" },
     };
 
-    static private String[][] formatDecimalThaiPadded =
+    private static String[][] formatDecimalThaiPadded =
     {
         { "\u0E50\u0E50\u0E51" },
         { "0", "\u0E50\u0E50\u0E50" },
@@ -168,7 +166,7 @@ public class NumberConverterTestCase {
         { "1000", "\u0E51\u0E50\u0E50\u0E50" },
     };
 
-    static private String[][] formatRomanLower =
+    private static String[][] formatRomanLower =
     {
         { "i" },
         { "0", "0" },
@@ -206,7 +204,7 @@ public class NumberConverterTestCase {
         { "5000", "5000" },
     };
 
-    static private String[][] formatRomanUpper =
+    private static String[][] formatRomanUpper =
     {
 
         { "I" },
@@ -245,7 +243,7 @@ public class NumberConverterTestCase {
         { "5000", "5000" },
     };
 
-    static private String[][] formatRomanLargeLower =
+    private static String[][] formatRomanLargeLower =
     {
         { "i", null, null, null, "large" },
         { "0", "0" },
@@ -293,7 +291,7 @@ public class NumberConverterTestCase {
         { "200000", "200000" },
     };
 
-    static private String[][] formatRomanLargeUpper =
+    private static String[][] formatRomanLargeUpper =
     {
         { "I", null, null, null, "large" },
         { "0", "0" },
@@ -341,7 +339,7 @@ public class NumberConverterTestCase {
         { "200000", "200000" },
     };
 
-    static private String[][] formatRomanNumberFormsLower =
+    private static String[][] formatRomanNumberFormsLower =
     {
         { "i", null, null, null, "unicode-number-forms" },
         { "0", "0" },
@@ -399,7 +397,7 @@ public class NumberConverterTestCase {
         { "200000", "200000" },
     };
 
-    static private String[][] formatRomanNumberFormsUpper =
+    private static String[][] formatRomanNumberFormsUpper =
     {
         { "I", null, null, null, "unicode-number-forms" },
         { "0", "0" },
@@ -457,7 +455,7 @@ public class NumberConverterTestCase {
         { "200000", "200000" },
     };
 
-    static private String[][] formatAlphabeticLatinLower =
+    private static String[][] formatAlphabeticLatinLower =
     {
         { "a" },
         { "0", "0" },
@@ -478,7 +476,7 @@ public class NumberConverterTestCase {
         { "1000000", "bdwgn" },
     };
 
-    static private String[][] formatAlphabeticLatinUpper =
+    private static String[][] formatAlphabeticLatinUpper =
     {
         { "A" },
         { "0", "0" },
@@ -499,7 +497,7 @@ public class NumberConverterTestCase {
         { "1000000", "BDWGN" },
     };
 
-    static private String[][] formatAlphabeticArabicHijai =
+    private static String[][] formatAlphabeticArabicHijai =
     {
         { "\u0627", null, null, "alphabetic" },
         { "0", "0" },
@@ -540,7 +538,7 @@ public class NumberConverterTestCase {
         { "1000000", "\u0623\u0638\u0636\u0635\u062F" },
     };
 
-    static private String[][] formatAlphabeticArabicAbjadi =
+    private static String[][] formatAlphabeticArabicAbjadi =
     {
         { "\u0627", null, null, "traditional" },
         { "0", "0" },
@@ -581,7 +579,7 @@ public class NumberConverterTestCase {
         { "1000000", "\u0623\u0641\u0633\u0646\u062D" },
     };
 
-    static private String[][] formatNumeralArabicAbjadi =
+    private static String[][] formatNumeralArabicAbjadi =
     {
         { "\u0623", null, null, "traditional" },
         { "0", "0" },
@@ -629,7 +627,7 @@ public class NumberConverterTestCase {
         { "2000", "2000" },
     };
 
-    static private String[][] formatAlphabeticHebrew =
+    private static String[][] formatAlphabeticHebrew =
     {
         { "\u05D0", null, null, "alphabetic" },
         { "0", "0" },
@@ -669,7 +667,7 @@ public class NumberConverterTestCase {
         { "1000000", "\u05D0\u05DA\u05E9\u05E8\u05D0" },
     };
 
-    static private String[][] formatNumeralHebrewGematria =
+    private static String[][] formatNumeralHebrewGematria =
     {
         { "\u05D0", null, null, "traditional" },
         { "0", "0" },
@@ -717,7 +715,7 @@ public class NumberConverterTestCase {
         { "2000", "2000" },
     };
 
-    static private String[][] formatAlphabeticThai =
+    private static String[][] formatAlphabeticThai =
     {
         { "\u0E01", null, null, "alphabetic" },
         { "0", "0" },
@@ -738,7 +736,7 @@ public class NumberConverterTestCase {
         { "1000000", "\u0E0B\u0E20\u0E17\u0E0C" },
     };
 
-    static private String[][] formatWordEnglishLower =
+    private static String[][] formatWordEnglishLower =
     {
         { "w", null, null, null, null, "eng" },
         { "0", "zero" },
@@ -762,7 +760,7 @@ public class NumberConverterTestCase {
         { "1000000000", "one billion" }
     };
 
-    static private String[][] formatWordEnglishUpper =
+    private static String[][] formatWordEnglishUpper =
     {
         { "W", null, null, null, null, "eng" },
         { "0", "ZERO" },
@@ -786,7 +784,7 @@ public class NumberConverterTestCase {
         { "1000000000", "ONE BILLION" }
     };
 
-    static private String[][] formatWordEnglishTitle =
+    private static String[][] formatWordEnglishTitle =
     {
         { "Ww", null, null, null, null, "eng" },
         { "0", "Zero" },
@@ -810,7 +808,7 @@ public class NumberConverterTestCase {
         { "1000000000", "One Billion" }
     };
 
-    static private String[][] formatWordSpanishLower =
+    private static String[][] formatWordSpanishLower =
     {
         { "w", null, null, null, null, "spa" },
         { "0", "cero" },
@@ -890,7 +888,7 @@ public class NumberConverterTestCase {
         { "1000000000", "mil millones" }
     };
 
-    static private String[][] formatWordSpanishUpper =
+    private static String[][] formatWordSpanishUpper =
     {
         { "W", null, null, null, null, "spa" },
         { "0", "CERO" },
@@ -970,7 +968,7 @@ public class NumberConverterTestCase {
         { "1000000000", "MIL MILLONES" }
     };
 
-    static private String[][] formatWordSpanishTitle =
+    private static String[][] formatWordSpanishTitle =
     {
         { "Ww", null, null, null, null, "spa" },
         { "0", "Cero" },
@@ -1050,7 +1048,7 @@ public class NumberConverterTestCase {
         { "1000000000", "Mil Millones" }
     };
 
-    static private String[][] formatWordFrenchLower =
+    private static String[][] formatWordFrenchLower =
     {
         { "w", null, null, null, null, "fra" },
         { "0", "z\u00e9ro" },
@@ -1141,7 +1139,7 @@ public class NumberConverterTestCase {
         { "1000000000", "un milliard" }
     };
 
-    static private String[][] formatWordFrenchUpper =
+    private static String[][] formatWordFrenchUpper =
     {
         { "W", null, null, null, null, "fra" },
         { "0", "Z\u00c9RO" },
@@ -1232,7 +1230,7 @@ public class NumberConverterTestCase {
         { "1000000000", "UN MILLIARD" }
     };
 
-    static private String[][] formatWordFrenchTitle =
+    private static String[][] formatWordFrenchTitle =
     {
         { "Ww", null, null, null, null, "fra" },
         { "0", "Z\u00e9ro" },
index 70bd568af3da10b42e3652cabbe8655b941b2cc3..4407254a861005a117d2c731cff97085434db0c5 100644 (file)
@@ -27,8 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * Test suite for bidirectional functionality.
  */
 @RunWith(Suite.class)
-@SuiteClasses({
-    NumberConverterTestCase.class
-})
+@SuiteClasses(NumberConverterTestCase.class)
 public class UtilTestSuite {
 }
index 8d7d4692803d7fc54c6857d1f0de1afccda302d0..fa4babfa233a7ed873b2d791c66cb17b54638eef 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 
 /**
index 84e8ee804c1ff73bb5398e1f5b6990df228b5592..591104412a12ed6b77e23cbb693c2aeb11d3198b 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 
 /**
index 3479c3794491693fb1bf7f8af080cbfc4295fb5d..11538dc33d230e8593728cc122685b5eaebd5c4d 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 
 /**
index 800e06d325aa03cc94710acf5408fd094e8e2bf2..4bacc180c3f65db08d728fbe9b26d5a101fbaaac 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 
 /**
index c9f6d98ffc087075e994984e325abd89281298f7..e05e44ab1e3e857acb3f6b95735861c330ed633e 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 
 public class FontsAutoDetectTestCase extends BaseConstructiveUserConfigTest {
index 2776c2cce49e5b20130a25ff89f80fd86b75d78a..aab7a2e7c8b90688d6471b5d7eda77eddbc37b21 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FopConfBuilder;
-import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 
 /**
index 23af20a1ac92ec182fdeec470b58e61c8f6fe980..f6e2b02bad6e0c7e33e134016d17965fa134f90a 100644 (file)
 
 package org.apache.fop.datatypes;
 
-import static org.junit.Assert.assertEquals;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Tests for URISpecification.
  */
index 87fc0432996efd4f785252ac73906b362e2f02ce..39e3fec9862e37787b88f2a5cbb909fd68994cab 100644 (file)
@@ -19,6 +19,8 @@
 
 package org.apache.fop.events;
 
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -26,7 +28,6 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import org.apache.fop.events.model.EventSeverity;
-import org.junit.Test;
 
 public class BasicEventTestCase {
 
index ff0bc2a81f2df07e4ef786c5ef7025e1fd3c007b..ff19c7ea61ec29e14e9e58e5a64ab890ee5385fe 100644 (file)
@@ -38,7 +38,10 @@ public interface TestEventProducer extends EventProducer {
      */
     void enjoy(Object source, String what);
 
-    public class Provider {
+    public static final class Provider {
+
+        private Provider() {
+        }
 
         public static TestEventProducer get(EventBroadcaster broadcaster) {
             return (TestEventProducer)broadcaster.getEventProducerFor(TestEventProducer.class);
index 313379e02f3909173ae40228ea3a8b260b377bc8..226c551fb761d85f1bac522c3d734959942b5892 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.fo;
 
-import static org.junit.Assert.assertArrayEquals;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
@@ -42,6 +40,8 @@ import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
+import static org.junit.Assert.assertArrayEquals;
+
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.FODocumentParser.FOEventHandlerFactory;
 import org.apache.fop.fo.flow.BasicLink;
index 7d03e38a6d4b0c81b1867bbc0441c0e58b7c0b5e..2e691519bf68d8b653ff4f761d9d8ff288dc213e 100644 (file)
@@ -64,7 +64,7 @@ public final class FODocumentParser {
     /**
      * A factory to create custom instances of {@link FOEventHandler}.
      */
-    public static interface FOEventHandlerFactory {
+    public interface FOEventHandlerFactory {
 
         /**
          * Creates a new {@code FOEventHandler} instance parameterized with the given FO user agent.
index ba969b9fae27502ff7b5cde010564e3339e2d914..97889c177da4b3929b050637aea96722f1b87dcb 100644 (file)
@@ -31,7 +31,6 @@ import org.apache.xmlgraphics.image.loader.ImageManager;
 import org.apache.xmlgraphics.image.loader.ImageSessionContext;
 
 import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.FopFactory;
 import org.apache.fop.events.EventBroadcaster;
 import org.apache.fop.fo.flow.table.ColumnNumberManager;
 import org.apache.fop.fo.flow.table.ColumnNumberManagerHolder;
@@ -46,7 +45,7 @@ public final class FONodeMocks {
     /**
      * Creates and returns a mock {@link FONode} configured with a mock
      * {@link FOEventHandler}. The FO event handler returns a mock {@link FOUserAgent},
-     * which in turn returns a mock {@link FopFactory}, which returns a mock
+     * which in turn returns a mock {@link org.apache.fop.apps.FopFactory}, which returns a mock
      * {@link ImageManager}.
      *
      * @return a mock FO node
index 983a531b05ee6ce0dfc912dbfca08672c7951710..09a4e129cf1fed6a4c8b756b71b81a61f18f9caa 100644 (file)
@@ -30,10 +30,6 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.flow.Marker;
-import org.apache.fop.fo.flow.Markers;
-import org.apache.fop.fo.flow.RetrieveMarker;
-import org.apache.fop.fo.flow.RetrieveTableMarker;
 
 public class MarkersTestCase {
 
index fb6ec6a250f3cbc1e48c97b76c892a6638b49966..0f0e347d392f6377e1d3f2da157baceb37f53ab2 100644 (file)
@@ -24,8 +24,8 @@ import java.util.Iterator;
 
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.FODocumentParser;
-import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FODocumentParser.FOEventHandlerFactory;
+import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.util.ConsoleEventListenerForTests;
 
 /**
index 7c0301ca7905bc5410db4d1cd44aac6011e36ac9..75ba53525bfc143ab285b198cb6cecd811a11ea2 100644 (file)
 
 package org.apache.fop.fo.flow.table;
 
-import static org.junit.Assert.assertEquals;
-
 import java.awt.Color;
 import java.util.Iterator;
 import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode.FONodeIterator;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground.BorderInfo;
 
+// CSOFF: LineLength
+
 /**
  * A testcase for the resolution of collapsed borders in the FO tree, taking
  * conditionality into account. The resolved borders are generated by the
index 361517a66cb4a4f85a7d1c24960837b3744673bf..88411644164817b1bc1981800ef4d94ab56876b8 100644 (file)
 
 package org.apache.fop.fo.flow.table;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 import java.util.Iterator;
 import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests that RowGroupBuilder returns, for each part of a table, the expected number of
  * row-groups with the expected number or rows in each.
index a21806559f9bd843989e1d6a8a36b197527b56dc..2df0cac2a869703066e98b43d14d90336cb673c5 100644 (file)
 
 package org.apache.fop.fo.flow.table;
 
-import static org.junit.Assert.assertEquals;
-
 import java.util.Iterator;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.fo.FObj;
 
index 11f24b99bb5a0257604689d1c3f4343e7f62c3e7..04da32b478e6cc74c2fc76ab068fa8ebc3a95742 100644 (file)
@@ -24,7 +24,6 @@ import java.util.List;
 
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.FOEventHandler;
-import org.apache.fop.fo.flow.table.Table;
 
 public class TableHandler extends FOEventHandler {
 
index 40990cb06c2e1a59788199a44048967a2a482608..bd5b21c1441928b169f2cde0b59045d0b032457a 100644 (file)
@@ -19,8 +19,8 @@
 
 package org.apache.fop.fo.pagination;
 
-import org.junit.runners.Suite;
 import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
 /**
  * All test to be added in FOTreeTestSuite
@@ -28,6 +28,6 @@ import org.junit.runner.RunWith;
  */
 @RunWith(Suite.class)
 @Suite.SuiteClasses({ PageSequenceMasterTestCase.class,
-        RepeatablePageMasterAlternativesTestCase.class})
+        RepeatablePageMasterAlternativesTestCase.class })
 public final class AllTests {
 }
index ad4f991acdb0a9c3cf2fcf1cc06d5f3e5f9641a9..d7bc2e11c7a5892d913b12c1628eaf5331824ddc 100644 (file)
 
 package org.apache.fop.fo.pagination;
 
-import static org.junit.Assert.fail;
+import org.junit.Test;
+import org.xml.sax.Locator;
 
+import static org.junit.Assert.fail;
 import static org.mockito.Matchers.anyBoolean;
 import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyObject;
@@ -33,8 +35,6 @@ import static org.mockito.Mockito.when;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.layoutmgr.BlockLevelEventProducer;
-import org.junit.Test;
-import org.xml.sax.Locator;
 
 
 /**
index 5ac4860dc6b531e6d3cb16615eb2c22523a9dc52..ce1a97638a4853c0d7cf09bd8b7d799da6080a19 100644 (file)
@@ -19,6 +19,8 @@
 
 package org.apache.fop.fo.pagination;
 
+import org.junit.Test;
+
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.anyBoolean;
 import static org.mockito.Matchers.anyInt;
@@ -30,8 +32,6 @@ import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.expr.NumericProperty;
 import org.apache.fop.fo.properties.Property;
 
-import org.junit.Test;
-
 /**
  * Unit Test for RepeatablePageMasterAlternatives
  *
index cd5d545ff576c02622c5c5370b251672d07b4126..89ed2733d50dce29bb1b1491a4647d0ae1ef06a6 100644 (file)
 
 package org.apache.fop.fo.properties;
 
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-import org.junit.Test;
-
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.Constants;
index 352a39713311551dd4e268f797c09af960d75182..81ebc2f418bbc1248fed9dc2df0c9d05df165143 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FONodeMocks;
index 20212b002827e5c9b85107884c5e732e1a7dc590..8c2621b51acab67ba81fd22faf487acef7e6e1ee 100644 (file)
@@ -24,11 +24,11 @@ import java.io.File;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.apps.io.InternalResourceResolver;
 import org.apache.fop.apps.io.ResourceResolverFactory;
 
-import static org.junit.Assert.assertEquals;
-
 /**
  *
  */
index ee3498a0358941e0eedd78a9cbd57e2fbc4b77de..c8099f860dd3d088b1a210e9d72057eba56abfff 100644 (file)
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertTrue;
  */
 public class EmbedFontInfoTestCase {
 
-    public EmbedFontInfoTestCase() {}
+    public EmbedFontInfoTestCase() { }
 
     private EmbedFontInfo sut;
 
index 073743c13dfe75f76886305977df6f4d679b6d70..d653171b782cbd9754eb8972d0cbe331cfe16dbf 100644 (file)
@@ -20,7 +20,6 @@
 package org.apache.fop.fonts;
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URI;
 
@@ -28,13 +27,14 @@ import org.junit.Before;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FopConfBuilder;
 import org.apache.fop.apps.FopConfParser;
 import org.apache.fop.apps.FopFactory;
 
 import static org.apache.fop.apps.FopConfParserTestCase.getFopFactory;
-import static org.junit.Assert.assertEquals;
 
 /**
  * A test case for {@link FontManagerConfigurator}.
@@ -84,7 +84,7 @@ public class FontManagerConfiguratorTestCase {
     /**
      * This test is an interesting one; it's basically testing that if a base URI pointing to a
      * directory that doesn't exist is used, an error is not thrown. The URI resolver should handle
-     * any {@link FileNotFoundException}s, not the configuration. We're NOT testing whether a font
+     * any {@link java.io.FileNotFoundException}s, not the configuration. We're NOT testing whether a font
      * can be resolved here, just that the URI resolver accepts it as its base URI.
      */
     @Test
index 64c7642ebd725dfeef03c13991feaa17192a7f52..97ea5c52bc005492a225891d75069ff3a4d0e92d 100644 (file)
@@ -26,14 +26,14 @@ import java.util.Random;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fontbox.cff.CFFDataInput;
 
 import org.apache.fop.fonts.cff.CFFDataReader.CFFIndexData;
 import org.apache.fop.fonts.cff.CFFDataReader.DICTEntry;
 import org.apache.fop.fonts.truetype.OTFSubSetFile;
 
-import static org.junit.Assert.assertEquals;
-
 public class CFFDataReaderTestCase {
     private CFFDataReader cffReader;
 
@@ -113,7 +113,7 @@ public class CFFDataReaderTestCase {
         //Array comparison
         int[] fontBBox = { -50, -40, 100, 120 };
         DICTEntry fontBBoxEntry = dictMap.get("FontBBox");
-        for (int i = 0;i < fontBBoxEntry.getOperands().size();i++) {
+        for (int i = 0; i < fontBBoxEntry.getOperands().size(); i++) {
             assertEquals(fontBBoxEntry.getOperands().get(i).intValue(), fontBBox[i]);
         }
         //Multi-byte offset (number)
@@ -141,7 +141,7 @@ public class CFFDataReaderTestCase {
         };
         Random randGen = new Random();
         byte[] data = new byte[31];
-        for (int i = 0;i < data.length;i++) {
+        for (int i = 0; i < data.length; i++) {
             data[i] = (byte)randGen.nextInt(255);
         }
         testIndex = OTFSubSetFile.concatArray(testIndex, data);
index e794ab1a8ea696fc447a22d18ecc102980643339..952c3ec1fe2c4c7324b0d97ea932ddda68243ed7 100644 (file)
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertTrue;
  */
 public class GlyfTableTestCase {
 
-    private final static class DirData {
+    private static final class DirData {
 
         final long offset;
         final long length;
index 737c2e05ebb6dff6c1a0015c620647a080600c3d..b4e2cee2e4aed40e7b50f762bcf9c25207cbf75c 100644 (file)
@@ -20,7 +20,6 @@
 package org.apache.fop.fonts.truetype;
 
 import java.io.FileInputStream;
-import java.io.IOException;
 import java.io.InputStream;
 
 import org.junit.Before;
@@ -37,7 +36,7 @@ public class OTFFileTestCase {
 
     /**
      * Initializes fonts used for the testing of reading OTF CFF
-     * @throws IOException
+     * @throws java.io.IOException
      */
     @Before
     public void setUp() throws Exception {
@@ -75,11 +74,11 @@ public class OTFFileTestCase {
 
         int[] gids = {32, 42, 44, 47};
         int[] sourceSansWidths = {516, 555, 572, 383};
-        for (int i = 0;i < gids.length;i++) {
+        for (int i = 0; i < gids.length; i++) {
             assertEquals(sourceSansWidths[i], sourceSansProBold.getWidths()[gids[i]]);
         }
         int[] carolynaWidths = {842, 822, 658, 784};
-        for (int i = 0;i < gids.length;i++) {
+        for (int i = 0; i < gids.length; i++) {
             assertEquals(carolynaWidths[i], alexBrush.getWidths()[gids[i]]);
         }
     }
index 604cca3a8c949342c4298ff0dd60abdddb449855..c555ebc20251ebc758358321c360deebfb3cc0e9 100644 (file)
@@ -27,6 +27,9 @@ import java.util.Map;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fontbox.cff.CFFDataInput;
 import org.apache.fontbox.cff.CFFFont;
 import org.apache.fontbox.cff.CFFParser;
@@ -37,9 +40,6 @@ import org.apache.fop.fonts.cff.CFFDataReader;
 import org.apache.fop.fonts.cff.CFFDataReader.CFFIndexData;
 import org.apache.fop.fonts.cff.CFFDataReader.DICTEntry;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 public class OTFSubSetFileTestCase extends OTFFileTestCase {
 
     CFFDataReader cffReaderSourceSans;
@@ -85,7 +85,7 @@ public class OTFSubSetFileTestCase extends OTFFileTestCase {
 
     private boolean checkCorrectOffsets(CFFIndexData indexData) {
         int last = 0;
-        for (int i = 0;i < indexData.getOffsets().length;i++) {
+        for (int i = 0; i < indexData.getOffsets().length; i++) {
             if (indexData.getOffsets()[i] < last) {
                 return false;
             }
@@ -107,7 +107,7 @@ public class OTFSubSetFileTestCase extends OTFFileTestCase {
         IndexData localIndexData = CFFParser.readIndexData(localSubrs);
 
         CFFIndexData charStrings = cffReader.getCharStringIndex();
-        for (int i = 0;i < charStrings.getNumObjects();i++) {
+        for (int i = 0; i < charStrings.getNumObjects(); i++) {
             byte[] charData = charStrings.getValue(i);
             Type2CharStringParser parser = new Type2CharStringParser();
 
index a390bef0fe05a64a92239b4147e86f21f3cd5318..32e527f9dac6f225214a15036f8f231161d23903 100644 (file)
@@ -26,12 +26,12 @@ import java.util.Map;
 
 import org.junit.Test;
 
-import org.apache.fop.fonts.truetype.OpenFont.PostScriptVersion;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.fop.fonts.truetype.OpenFont.PostScriptVersion;
+
 /**
  * Class for testing org.apache.fop.fonts.truetype.TTFFile
  */
index f50b116ac28fd1d65d06cc62e08191a3672a3f3c..899fe1d737cd0daaaa9565bddc31b4f9628a4860 100644 (file)
@@ -25,14 +25,14 @@ import java.net.URI;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.apps.io.InternalResourceResolver;
 import org.apache.fop.apps.io.ResourceResolverFactory;
 import org.apache.fop.fonts.EmbeddingMode;
 import org.apache.fop.fonts.EncodingMode;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 /**
  * Test case for {@link OFFontLoader}.
  */
index 93443a0d905ca87c4257119b782f76f2e6a80ff3..5e31054b55fec18ac649db39e08c64876e15d778 100644 (file)
@@ -19,9 +19,6 @@
 
 package org.apache.fop.fonts.type1;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.awt.Rectangle;
 import java.io.IOException;
 import java.io.InputStream;
@@ -29,6 +26,9 @@ import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Test case for {@link AFMParser}.
  */
index 10ba421190481677a38efb220c0777b70d30ab62..a3a3e1c401dac74c2baa91d5757d6494891cfb75 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.fonts.type1;
 
-import static org.junit.Assert.assertEquals;
-
 import java.io.BufferedReader;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -30,6 +28,8 @@ import java.io.InputStreamReader;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Test case for {@link AdobeStandardEncoding}.
  */
index de9af2d338fa8ff8e462c5f54b6b7c9cc7c5973f..c3e9334dd45af72cc0fdbbaf0bd7ac84680432fb 100644 (file)
 
 package org.apache.fop.fonts.type1;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import java.awt.Rectangle;
 import java.io.IOException;
 import java.util.HashMap;
@@ -31,6 +27,10 @@ import java.util.Stack;
 
 import org.junit.Test;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import org.apache.fop.fonts.NamedCharacter;
 import org.apache.fop.fonts.type1.AFMParser.ValueHandler;
 
index 5070984d18444f8a5a959ee41de928eaabef8c6e..955644ae45fd3532c1547e52d5dec00ecdeea653 100644 (file)
@@ -20,6 +20,9 @@
 package org.apache.fop.fotreetest.ext;
 
 
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOPropertyMapping;
@@ -32,9 +35,6 @@ import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.SpaceProperty;
 import org.apache.fop.fotreetest.ResultCollector;
 
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-
 /**
  * Defines the assert element for the FOP Test extension.
  */
index eee0efac43da2a6787b0fee1e58ccce5e3775d42..b61944eae7e01842407d42ed843eaef710a5e870 100644 (file)
@@ -19,8 +19,8 @@
 
 package org.apache.fop.fotreetest.ext;
 
-import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.ElementMapping;
+import org.apache.fop.fo.FONode;
 
 /**
  * This class provides the element mapping for FOP.
index f4763512a3035564286876dcbf3a5f7381b2af97..7f3036c24198cc5944b10d0123bd63658835c61a 100644 (file)
 
 package org.apache.fop.image.loader.batik;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-
 import java.awt.image.Raster;
 import java.awt.image.RenderedImage;
 import java.io.File;
@@ -30,6 +26,10 @@ import java.io.File;
 import org.junit.Ignore;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
 import org.apache.xmlgraphics.image.loader.Image;
 import org.apache.xmlgraphics.image.loader.ImageFlavor;
 import org.apache.xmlgraphics.image.loader.ImageInfo;
index efc5df1f75572a3a80710c611cdd453b3bb12697..3d690b67cda3abd284e44b1f029f6fc431b2c8ab 100644 (file)
 
 package org.apache.fop.image.loader.batik;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import java.io.File;
 import java.io.IOException;
 
 import org.junit.Ignore;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import org.apache.xmlgraphics.image.loader.ImageException;
 import org.apache.xmlgraphics.image.loader.ImageInfo;
 import org.apache.xmlgraphics.image.loader.ImageManager;
index 419db2c4703ee8c9ec41ece3a39296d556431c5e..48c3f335bcee26952babecfc8bfbbc1b723bab32 100644 (file)
@@ -34,7 +34,6 @@ import javax.xml.validation.SchemaFactory;
 import javax.xml.validation.Validator;
 
 import org.w3c.dom.Document;
-
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
index 3fc855cefbe2674cac967e096ca38a11284f365a..2003958c8c3e52c94d1a896c4a0a3e28f8065d9b 100644 (file)
@@ -27,6 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * JUnit test suite for the area tree XML format
  */
 @RunWith(Suite.class)
-@SuiteClasses({ AreaTreeParserTestCase.class })
+@SuiteClasses(AreaTreeParserTestCase.class)
 public class AreaTreeXMLFormatTestSuite {
 }
index 58281fc10288f1e1e5a3b5f02e952bb38e82b1d8..83dd886617b6ddbaf348553f7b24904738152fda 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.intermediate;
 
-import static org.junit.Assert.fail;
-
 import java.io.File;
 
 import javax.xml.transform.ErrorListener;
@@ -34,6 +32,8 @@ import javax.xml.transform.stream.StreamSource;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.fail;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.Fop;
index f960990b2a9b739b06371d5a8514f1352407e319..71b26cb9b2880d66a083ad8dd8f2b84d22e4e527 100644 (file)
@@ -27,6 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * A test suite for testing the Intermediate Format output.
  */
 @RunWith(Suite.class)
-@SuiteClasses({ IFTestCase.class })
+@SuiteClasses(IFTestCase.class)
 public final class IntermediateFormatTestSuite {
 }
index 5d87df1a5d4997bfa0229db867606837143b0d0f..ea60f2ff4526df4f5162adc2261638a62e6adc50 100644 (file)
@@ -27,6 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * JUnit test suite for the intermediate format
  */
 @RunWith(Suite.class)
-@SuiteClasses({ IFParserTestCase.class })
+@SuiteClasses(IFParserTestCase.class)
 public final class LayoutIFTestSuite {
 }
index e63fc3291eb94653b5ab3275c0b9080532f008f2..4d33d670bacd1d04e32956b987c98500007efc45 100644 (file)
@@ -22,16 +22,17 @@ package org.apache.fop.layoutengine;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.fop.layoutmgr.KnuthBox;
-import org.apache.fop.layoutmgr.KnuthElement;
-import org.apache.fop.layoutmgr.KnuthGlue;
-import org.apache.fop.layoutmgr.KnuthPenalty;
 import org.w3c.dom.CDATASection;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
 
+import org.apache.fop.layoutmgr.KnuthBox;
+import org.apache.fop.layoutmgr.KnuthElement;
+import org.apache.fop.layoutmgr.KnuthGlue;
+import org.apache.fop.layoutmgr.KnuthPenalty;
+
 /**
  * Check implementation that checks a Knuth element list.
  */
index 2a70f255d79553b421029fda90917ed880bfe28f..89bf28a55e0953fae2e71245d3e28ad17ea31d59 100644 (file)
@@ -27,6 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * JUnit test suit for running layout engine test under JUnit control.
  */
 @RunWith(Suite.class)
-@SuiteClasses({ LayoutEngineTestCase.class })
+@SuiteClasses(LayoutEngineTestCase.class)
 public class LayoutEngineTestSuite {
 }
index 52c83daa88beeaded5ffc883eb99287ad6939162..92c459234c70964b45d90a10193bef05a85547e0 100644 (file)
 
 package org.apache.fop.layoutengine;
 
-import org.apache.fop.apps.FormattingResults;
 import org.w3c.dom.Document;
 
+import org.apache.fop.apps.FormattingResults;
+
 /**
  * This class holds references to all the results from the FOP processing run.
  */
index c2fc84551ce68dd0f874e04e1aa883edfa0687f6..629e5f1c64e6b1a16b6d4cf3d1634f6dea02df9f 100644 (file)
@@ -23,6 +23,10 @@ import java.awt.Color;
 
 import org.junit.Test;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import org.apache.fop.fo.flow.table.PrimaryGridUnit;
 import org.apache.fop.fo.flow.table.Table;
 import org.apache.fop.fo.flow.table.TableCell;
@@ -37,10 +41,6 @@ import org.apache.fop.layoutmgr.PageSequenceLayoutManager;
 import org.apache.fop.layoutmgr.PositionIterator;
 import org.apache.fop.layoutmgr.RetrieveTableMarkerLayoutManager;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 public class TableCellLayoutManagerTestCase {
 
     // this test aims to check that the first call to addAreas() calls
index 26c4db00e3755c705eedbb5c3a19e29482bed490..7824a6b8b8954cbb074f09bf3f125c64933cb873 100644 (file)
@@ -24,9 +24,10 @@ import java.util.ListIterator;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
+import org.apache.fop.layoutmgr.ElementListObserver.Observer;
 import org.apache.fop.layoutmgr.ElementListUtils;
 import org.apache.fop.layoutmgr.ListElement;
-import org.apache.fop.layoutmgr.ElementListObserver.Observer;
 
 /**
  * <p>Logs all observed element lists.
index 7afb80476824f6ed342119a560841609e7aeea0f..efe0cc489059ac898904b7fe7fea1cce830581ae 100644 (file)
@@ -45,7 +45,7 @@ import org.apache.fop.apps.MimeConstants;
 /**
  * Debug tool to create and process large FO files by replicating them a specified number of times.
  */
-public class MemoryEater {
+public final class MemoryEater {
 
     private SAXTransformerFactory tFactory
             = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
@@ -53,7 +53,7 @@ public class MemoryEater {
 
     private Stats stats;
 
-    public MemoryEater() throws TransformerConfigurationException, MalformedURLException {
+    private MemoryEater() throws TransformerConfigurationException, MalformedURLException {
         File xsltFile = new File("test/xsl/fo-replicator.xsl");
         Source xslt = new StreamSource(xsltFile);
         replicatorTemplates = tFactory.newTemplates(xslt);
index 95d5c0a1d9c3c565a68e69c3eb4674d42748dd3a..dec62c0a43204f9dbdb96a70d6bfe8d4575e1861 100644 (file)
@@ -23,10 +23,11 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
-import static org.junit.Assert.assertEquals;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Test case for {@link AbstractPDFStream}.
  */
index a9d7bf4f6cb7a736d8b40f33321955354ab3b3f2..3301fff9e171d7eddfdd495b654d0bab5d016ea0 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -33,6 +29,10 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests the {@link FileIDGenerator} class.
  */
@@ -96,7 +96,7 @@ public class FileIDGeneratorTestCase {
         assertTrue(Arrays.equals(originalFileID, updatedFileID));
     }
 
-    private static interface TestGetter {
+    private interface TestGetter {
         FileIDGenerator getSut() throws Exception;
     }
 
index 89d9800295b7e5099d51e7f5333dcd53e5cad6df..21eb6088f7a8b9df160a582e5bc5dcd80a343f57 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.pdf.xref.CompressedObjectReference;
 
 public class ObjectStreamManagerTestCase {
index 317828e4ba1190cdf194572c2d3c38bf8812c54e..3512e11475d017b4fe20efa0d77514abe8b2262a 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
@@ -29,6 +27,8 @@ import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 public class ObjectStreamTestCase {
 
     private static final String OBJECT_CONTENT = "<<\n  /Foo True\n  /Bar False\n>>\n";
index 352e0710e01fd1384671da674adf6cee0f2e08b6..68609575a80a4604352ccf318d27e2768dd46d4d 100644 (file)
@@ -97,7 +97,7 @@ public class PDFAModeTestCase {
     }
 
     @Test
-    public void checkPDFA_1a() {
+    public void checkPDFA1a() {
         new PDFAModeChecker(PDFAMode.PDFA_1A)
                 .isEnabled()
                 .isPart1()
@@ -106,7 +106,7 @@ public class PDFAModeTestCase {
     }
 
     @Test
-    public void checkPDFA_1b() {
+    public void checkPDFA1b() {
         new PDFAModeChecker(PDFAMode.PDFA_1B)
                 .isEnabled()
                 .isPart1()
@@ -115,7 +115,7 @@ public class PDFAModeTestCase {
     }
 
     @Test
-    public void checkPDFA_2a() {
+    public void checkPDFA2a() {
         new PDFAModeChecker(PDFAMode.PDFA_2A)
                 .isEnabled()
                 .isNotPart1()
@@ -124,7 +124,7 @@ public class PDFAModeTestCase {
     }
 
     @Test
-    public void checkPDFA_2b() {
+    public void checkPDFA2b() {
         new PDFAModeChecker(PDFAMode.PDFA_2B)
                 .isEnabled()
                 .isNotPart1()
@@ -133,7 +133,7 @@ public class PDFAModeTestCase {
     }
 
     @Test
-    public void checkPDFA_2u() {
+    public void checkPDFA2u() {
         new PDFAModeChecker(PDFAMode.PDFA_2U)
                 .isEnabled()
                 .isNotPart1()
index 418b2f1a9fec9ffc9409d5b86cc6b652f3810c35..53e9bdba0bfc8545cbc159d1ac9f08efc193979b 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 /**
  * Test case for {@link PDFArray}.
index 49c1e6dab2811f435061ef115e26b5aaed8754a3..4655b258d79641563ce556f72d2015da1488a031 100644 (file)
 
 package org.apache.fop.pdf;
 
-import org.junit.Before;
-import org.junit.Test;
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.junit.Before;
+import org.junit.Test;
+
 /**
  * Test case for {@link PDFDests}.
  */
index 00224e93e4705399b750beed8c205fb2ac35cd31..267e05c2cff3bfc76a13cec318bc8c1d1705307e 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.commons.io.output.CountingOutputStream;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.io.output.CountingOutputStream;
+
 
 /**
  * Test case for {@link PDFDictionary}.
index c7eff506e4fe6875e41362b43dea49ca1c8dce5d..880613a781932f77d91aaeed78096dbfba00e4cc 100644 (file)
@@ -24,8 +24,6 @@ import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.Graphics2D;
 
-import junit.framework.Assert;
-
 import org.junit.Test;
 
 import org.apache.commons.io.output.ByteArrayOutputStream;
@@ -34,6 +32,8 @@ import org.apache.xmlgraphics.util.UnitConv;
 
 import org.apache.fop.svg.PDFDocumentGraphics2D;
 
+import junit.framework.Assert;
+
 /**
  * Tests for {@link PDFDocumentGraphics2D}.
  */
index 8965635b901e3c058e1d44b4afda29f3d7688958..e58201f1309a5bbf0b2d14a2303bd8ad7c92a36d 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 
 import org.junit.Test;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Test case for {@link PDFDocument}
index 34e48f1a648fa87cda5fd7d17dc322bdc89fe4cc..2f80b077c96fcaa746a35a26f250b7ea65fcfc3e 100644 (file)
@@ -19,11 +19,11 @@ package org.apache.fop.pdf;
 
 import org.junit.Test;
 
-import org.apache.fop.fonts.CodePointMapping;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
+import org.apache.fop.fonts.CodePointMapping;
+
 public class PDFEncodingTestCase {
 
     /**
index ea3b011c7f90ba1f213f921d8894f3d647b0ac12..e3f8344e034909bdea26fc77a920d6e8e26ff595 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -43,6 +39,10 @@ import javax.crypto.spec.SecretKeySpec;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests the {@link PDFEncryptionJCE} class.
  */
index 2504d871a5482e8b9e3c9a55c72b6e702c66f9e5..d1cc6273d502d725313ed55fb530071624532413 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertFalse;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
+
 public class PDFFilterListTestCase {
 
     @Test
index 80917f416041fe9f0830d486795277055bc969ce..8d7321496ae5855cae433f75bee0d56618ac4fcb 100644 (file)
@@ -22,11 +22,13 @@ package org.apache.fop.pdf;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.commons.io.output.CountingOutputStream;
 import org.junit.Before;
 import org.junit.Test;
-import static org.junit.Assert.fail;
+
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.io.output.CountingOutputStream;
 
 /**
  * Test class for {@link PDFName}.
index 98427cd200bf7aeaabca53f30cd50470cfcb8938..87dacc7f67918a593ec120bb2f6f50df61b9d010 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 
 import org.junit.Test;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Test case for {@link PDFNull}.
index ed660af8dff925d198bbeb9dd165916447f6cb0f..65f484dc7170ec3b5380cbb3a8db38d737d7d19d 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import java.io.IOException;
 
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.IOException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 /**
  * This test tests PDFNumber's doubleOut() methods.
index e0dca33bf48823aa2fb3b49c16446b25c70f0596..d36775cdac42b5a4655be2d03ddc5cf3d28dadb9 100644 (file)
 
 package org.apache.fop.pdf;
 
+import java.io.IOException;
+
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.IOException;
-
 /**
  * Test case for {@link PDFNumsArray}.
  */
index 10ffa3b27fe7311ea46861325cc6153672eccf9a..f35d2a15c44c369753488389a1380b4edefbf216 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 /**
  * Tests the PDFObject class.
  */
index 24b6a1c7146759a8cf085f78dbc575c062de1846..ed87cd23e6a02a39f04d04d4677e026f2f6e8c3b 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
 /**
  * Test case for {@link PDFRectangle}.
  */
index a2c6193cfe1825515e6d33fce33d4da7e3d88bfc..4e0e8814de5695e83895dc9cc2fd80e4909a4f7f 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertEquals;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 
 import org.junit.Test;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Test case for {@link PDFReference}.
index 20e38a6000d864d8437aa3dfe2b1953c67454a65..b5fb66e0038a906e3fa512bd7fa8ed5026ceebc5 100644 (file)
 
 package org.apache.fop.pdf;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 public class PDFStreamTestCase {
 
     private PDFStream stream;
index a1d581402228a8cd6ddfb9805ddab9e19aba16b8..2fa5008ed53119d1550ad223160c78990b80730d 100644 (file)
@@ -109,14 +109,14 @@ public class TableHeaderScopeTestCase {
     }
 
     private PDFDictionary scopeAttribute(Scope scope) {
-        return argThat(new isScopeAttribute(scope));
+        return argThat(new IsScopeAttribute(scope));
     }
 
-    private static class isScopeAttribute extends ArgumentMatcher<PDFDictionary> {
+    private static class IsScopeAttribute extends ArgumentMatcher<PDFDictionary> {
 
         private final Scope expectedScope;
 
-        public isScopeAttribute(Scope expectedScope) {
+        public IsScopeAttribute(Scope expectedScope) {
             this.expectedScope = expectedScope;
         }
 
index 74637c91f3d080cf9ae4db75d7ca47bff507bccf..e14fc9502495ec6232df9426e7c30e219cab8583 100644 (file)
 
 package org.apache.fop.pdf;
 
+import org.junit.Before;
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
-import org.junit.Before;
-import org.junit.Test;
-
 
 /**
  * A test class for {@link VersionController}.
index 9c90f09666ae1fb2176bcb0267ce5e6e1b419b9d..dd2731d8b5581751f28d1e66ebefa5b900d6d688 100644 (file)
 
 package org.apache.fop.pdf;
 
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Test;
-
 /**
  * This is a test case for ({@link Version}.
  */
index 8b103d277396e1285ca22a4cbd6bf40aee057580..b7a326c64e452886613806e1bab1a1154fcebae6 100644 (file)
 
 package org.apache.fop.pdf.xref;
 
-import static org.junit.Assert.assertArrayEquals;
-
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertArrayEquals;
+
 public class CompressedObjectReferenceTestCase extends ObjectReferenceTest {
 
     @Test
index df1b86e5306a95835da956d71cf2fb19b6c8f16a..cd55577cd23fa6a28526ea131d2a222bc9717681 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.pdf.xref;
 
-import static org.junit.Assert.assertArrayEquals;
-
 import java.io.ByteArrayOutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -32,6 +30,8 @@ import java.util.Map;
 
 import org.junit.Before;
 
+import static org.junit.Assert.assertArrayEquals;
+
 import org.apache.fop.pdf.PDFDocument;
 import org.apache.fop.pdf.PDFInfo;
 import org.apache.fop.pdf.PDFPages;
index b147084e8c37b3f0b3f8aa0a36497c00dbbcf738..a9f506aaa9220084721738b5a254451cfe761d52 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.pdf.xref;
 
-import static org.junit.Assert.assertArrayEquals;
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -28,6 +26,8 @@ import java.util.List;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertArrayEquals;
+
 public class UncompressedObjectReferenceTestCase extends ObjectReferenceTest {
 
     @Test
index 9d196e71d042eba19bb81ad492048a474691277a..297a9ba05e125ee0f9fc8521fa2859bbda272429 100644 (file)
@@ -33,6 +33,7 @@ import javax.xml.transform.stream.StreamSource;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
+
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.Fop;
 import org.apache.fop.apps.FopFactory;
index e6660bb4207a5c22f521375b95a7695965d110a0..506556c6629c8ccd66e230305c887eef88b023d4 100644 (file)
@@ -28,9 +28,9 @@ import org.apache.xmlgraphics.image.loader.ImageSize;
 
 public final class RawPNGTestUtil {
 
-    private static int NUM_ROWS = 32;
-    private static int NUM_COLUMNS = 32;
-    private static int DPI = 72;
+    private static final int NUM_ROWS = 32;
+    private static final int NUM_COLUMNS = 32;
+    private static final int DPI = 72;
 
     private RawPNGTestUtil() {
 
@@ -83,7 +83,7 @@ public final class RawPNGTestUtil {
     }
 
     /**
-     * 
+     *
      * @return a default ImageSize
      */
     public static ImageSize getImageSize() {
index 4bed835ec605c59e1d3da26d0bf8fcd148612b68..1fa4ae0fa93c610bf7cce2907b9a8e5eef026eb1 100644 (file)
 
 package org.apache.fop.render;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.io.File;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import org.apache.commons.io.output.NullOutputStream;
 
 import org.apache.fop.apps.FOPException;
index 691d75f3f1b6dcc54f9832dfa28a6d0cb11559b3..dfe956d903b440c31d130531e8877a169cc6d722 100644 (file)
 
 package org.apache.fop.render.afp;
 
-import static org.junit.Assert.assertTrue;
-
 import java.awt.Color;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.afp.AFPBorderPainter;
 import org.apache.fop.afp.AFPLineDataInfo;
 import org.apache.fop.afp.AFPPaintingState;
@@ -32,8 +35,6 @@ import org.apache.fop.afp.BorderPaintingInfo;
 import org.apache.fop.afp.DataStream;
 import org.apache.fop.afp.Factory;
 import org.apache.fop.fo.Constants;
-import org.junit.Before;
-import org.junit.Test;
 
 public class AFPBorderPainterTestCase {
     private ByteArrayOutputStream outStream;
@@ -63,12 +64,12 @@ public class AFPBorderPainterTestCase {
         ds.endDocument();
         assertTrue(line.getX1() == 4999 && line.getX2() == 8332);
     }
-    
+
     class MyDataStream extends DataStream {
         public MyDataStream(Factory factory, AFPPaintingState paintingState, OutputStream outputStream) {
             super(factory, paintingState, outputStream);
         }
-        
+
         public void createLine(AFPLineDataInfo lineDataInfo) {
             line = lineDataInfo;
         }
index 799045872ff060c0e03344eca9fdb5163d42b881..8ed54049ffccaf9da3817bfa8561fd5a56532094 100644 (file)
@@ -25,6 +25,10 @@ import java.util.Map;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import org.apache.fop.afp.AFPConstants;
 import org.apache.fop.apps.AFPRendererConfBuilder;
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
@@ -33,9 +37,6 @@ import org.apache.fop.render.afp.AFPRendererConfig.ImagesModeOptions;
 
 import static org.apache.fop.render.afp.AFPRendererConfig.ImagesModeOptions.MODE_COLOR;
 import static org.apache.fop.render.afp.AFPRendererConfig.ImagesModeOptions.MODE_GRAYSCALE;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
 
 public class AFPRendererConfigParserTestCase
         extends AbstractRendererConfigParserTester<AFPRendererConfBuilder, AFPRendererConfig> {
index 115b3149a3407e769a057d97dfc927c6700603cf..48cf892406a8abf90db0c1177b76cf51cebd15aa 100644 (file)
@@ -24,6 +24,9 @@ import java.util.Map;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verify;
+
 import org.apache.fop.afp.AFPResourceLevel;
 import org.apache.fop.afp.AFPResourceLevel.ResourceType;
 import org.apache.fop.afp.AFPResourceLevelDefaults;
@@ -33,9 +36,6 @@ import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.render.afp.AFPRendererConfig.AFPRendererConfigParser;
 import org.apache.fop.render.afp.AFPRendererConfig.ImagesModeOptions;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.verify;
-
 public class AFPRendererConfiguratorTestCase extends
         AbstractRendererConfiguratorTest<AFPRendererConfigurator, AFPRendererConfBuilder> {
 
index 78578a2b662c3e3688c49f6c6c9c073e7d676cc0..9e83829f867ffa3307ea78e7f9c28fe838a03fcd 100644 (file)
 
 package org.apache.fop.render.afp;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import org.apache.commons.io.IOUtils;
+
 import org.apache.fop.afp.AFPConstants;
 import org.apache.fop.afp.parser.MODCAParser;
 import org.apache.fop.afp.parser.UnparsedStructuredField;
 import org.apache.fop.apps.FOUserAgent;
-import org.junit.Test;
 
 /**
  * Tests generation of afp:no-operation (NOPs).
index 04f872a84ec509b7c519280f8520f52ffd93e013..cae184d51b8c31b7edf8707c2eab57f6ace71511 100644 (file)
@@ -24,6 +24,11 @@ import java.awt.image.BufferedImage;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
 import org.apache.fop.apps.BitmapRendererConfBuilder;
 import org.apache.fop.render.bitmap.BitmapRendererConfig.BitmapRendererConfigParser;
@@ -36,10 +41,6 @@ import static org.apache.fop.render.bitmap.BitmapRendererOption.COLOR_MODE_RGBA;
 import static org.apache.fop.render.bitmap.BitmapRendererOption.JAVA2D_TRANSPARENT_PAGE_BACKGROUND;
 import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_QUALITY;
 import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_SPEED;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
 
 public class AbstractBitmapRendererConfigParserTester
         extends AbstractRendererConfigParserTester<BitmapRendererConfBuilder, BitmapRendererConfig> {
index 3e0c8c203c5f482556940ce0391971f4fa8b479a..dcbb27754178e6e79e73c7bbf8f5fc46ed9f7f80 100644 (file)
@@ -23,6 +23,11 @@ import java.awt.image.BufferedImage;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
 import org.apache.fop.apps.AbstractRendererConfiguratorTest;
 import org.apache.fop.apps.BitmapRendererConfBuilder;
 import org.apache.fop.render.intermediate.IFDocumentHandler;
@@ -35,10 +40,6 @@ import static org.apache.fop.render.bitmap.BitmapRendererOption.COLOR_MODE_RGB;
 import static org.apache.fop.render.bitmap.BitmapRendererOption.COLOR_MODE_RGBA;
 import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_QUALITY;
 import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_SPEED;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
 
 public abstract class AbstractBitmapRendererConfiguratorTest extends
         AbstractRendererConfiguratorTest<BitmapRendererConfigurator, BitmapRendererConfBuilder> {
index d33076983e70cf28d41c3abb19826112a4a1bcb4..8a5c2a72d43c5fc237667cb9561a484e95d6e24c 100644 (file)
@@ -21,16 +21,16 @@ package org.apache.fop.render.bitmap;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.xmlgraphics.image.writer.Endianness;
 
 import org.apache.fop.apps.FopConfBuilder;
 import org.apache.fop.apps.TIFFRendererConfBuilder;
 import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 public class TIFFRendererConfigParserTestCase
 extends AbstractBitmapRendererConfigParserTester {
 
index b5e6318ce98bf0db3867315b15a564b6c50d6f98..e340830f4bd509274c0555d9da6f95b3d28efac1 100644 (file)
@@ -23,6 +23,10 @@ import java.awt.image.BufferedImage;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.xmlgraphics.image.writer.Endianness;
 
 import org.apache.fop.apps.FopConfBuilder;
@@ -32,9 +36,6 @@ import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser;
 
 import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T4;
 import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T6;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 public class TIFFRendererConfiguratorTestCase extends AbstractBitmapRendererConfiguratorTest {
 
index 6e48845c185534065de609435881dfdd39375228..e3f892e7cce1cf67387fc58d4672f2601b748ac8 100644 (file)
 
 package org.apache.fop.render.extensions.prepress;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
 import java.awt.Dimension;
 import java.awt.Rectangle;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
 /**
  * Tests for the fox:bleed, fox:crop-offset, fox:crop-box extension properties.
  */
index ff07e63ce2ffd424f497e73463cb5b5517381fc7..9de045cf79883adcd99d7420bcbfc5fa2c6b33d6 100644 (file)
 
 package org.apache.fop.render.extensions.prepress;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
 import java.awt.geom.Point2D;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
 /**
  * Tests for the fox:scale extension property.
  */
index be8b5d718aba013826874d4c1ce8c621bcb37d15..ec0f357379fbeb2291d9e2bc3fcb697778300d4e 100644 (file)
@@ -26,15 +26,15 @@ import org.junit.Before;
 import org.junit.Test;
 import org.w3c.dom.Document;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.render.RenderingContext;
 import org.apache.fop.traits.BorderProps;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 public class AbstractIFPainterTestCase {
 
     private AbstractIFPainter<?> sut;
index 61093c6299b26fadddf3f3a809ef2e0d6b2d603a..039ddcf90bcb2d8c43b6ec28fb64a026065d8f9d 100644 (file)
@@ -76,4 +76,4 @@ public class ArcToBezierCurveTransformerTestCase {
             fail("Angle " + angle + " is in (0, " + Math.PI / 2 + ")");
         }
     }
-}
\ No newline at end of file
+}
index f0e9522d9b7a1918cdf2d1d6c1d870f0f4a3d045..4a89b3ac6acec05f858b127cc93db4eed6220ad7 100644 (file)
@@ -575,4 +575,4 @@ public class BorderPainterTestCase {
     }
 
 
-}
\ No newline at end of file
+}
index 4df3fe278d00adbfade90e34f395f3625856e97f..5546e59058d2ed9be8406d18322d7496bc748927 100644 (file)
 
 package org.apache.fop.render.intermediate;
 
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentMatcher;
@@ -36,6 +28,14 @@ import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.argThat;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
 import org.apache.fop.fo.FOElementMapping;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.fo.extensions.InternalElementMapping;
index c5aad66d0ad96eeafc16e8d049a34e3aac5488d8..757d6620b6d1061a9116a5483d83211e1fd20d6d 100644 (file)
 package org.apache.fop.render.intermediate;
 
 
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.InOrder;
@@ -32,6 +28,10 @@ import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
 import org.apache.fop.render.intermediate.IFStructureTreeBuilder.SAXEventRecorder;
 import org.apache.fop.util.XMLUtil;
 
index 00631af4b07bccdfb28d08a4eb5e81ae7ab34e51..e87c8713d691df96f3ec17c94d70ca5c5ce9aa3d 100644 (file)
@@ -21,17 +21,14 @@ package org.apache.fop.render.java2d;
 
 import org.junit.Test;
 
-import org.apache.avalon.framework.configuration.Configuration;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.Java2DRendererConfBuilder;
 import org.apache.fop.render.java2d.Java2DRendererConfig.Java2DRendererConfigParser;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 public class Java2DRendererConfigParserTestcase
         extends AbstractRendererConfigParserTester<Java2DRendererConfBuilder, Java2DRendererConfig> {
 
index 113c3e2bd29a0bc2b66cff709502e6001863a46a..caf5348545d7ad7146135b120c8de3ce9a9983b9 100644 (file)
@@ -21,13 +21,13 @@ package org.apache.fop.render.pcl;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.render.pcl.PCLRendererConfig.PCLRendererConfigParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class PCLRendererConfigParserTestCase
         extends AbstractRendererConfigParserTester<PCLRendererConfBuilder, PCLRendererConfig> {
 
index 024104179420197c8b763c2c7af6f83e1c6062d0..fc7175ad6de18e7b6a9be06cead1762e27a35713 100644 (file)
@@ -19,16 +19,16 @@ package org.apache.fop.render.pcl;
 
 import org.junit.Test;
 
-import org.apache.fop.apps.AbstractRendererConfiguratorTest;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.pcl.PCLRendererConfig.PCLRendererConfigParser;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.when;
 
+import org.apache.fop.apps.AbstractRendererConfiguratorTest;
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.render.pcl.PCLRendererConfig.PCLRendererConfigParser;
+
 public class PCLRendererConfiguratorTestCase extends
         AbstractRendererConfiguratorTest<PCLRendererConfigurator, PCLRendererConfBuilder> {
 
index 94c842e684bcb54b3178c934db45def379f370e6..6aad0320eb633a48cdb3f7e3518dcf5694e13fb1 100644 (file)
@@ -25,11 +25,11 @@ import java.io.IOException;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
+import static org.junit.Assert.fail;
+
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.pdf.PDFConformanceException;
 
-import static org.junit.Assert.fail;
-
 /**
  * Tests PDF/A-1 functionality.
  */
index 1606bf073a62c29df0112937c2b05178c0dd6898..6ff40b3c3b50b5b23576782adda4ff766c7f245d 100644 (file)
 
 package org.apache.fop.render.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
 import java.util.Calendar;
 import java.util.TimeZone;
 
-import org.apache.fop.pdf.PDFDocument;
-import org.apache.fop.pdf.PDFInfo;
-import org.apache.fop.pdf.PDFMetadata;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 import org.apache.xmlgraphics.xmp.Metadata;
 import org.apache.xmlgraphics.xmp.schemas.DublinCoreAdapter;
 import org.apache.xmlgraphics.xmp.schemas.DublinCoreSchema;
@@ -35,7 +34,10 @@ import org.apache.xmlgraphics.xmp.schemas.XMPBasicAdapter;
 import org.apache.xmlgraphics.xmp.schemas.XMPBasicSchema;
 import org.apache.xmlgraphics.xmp.schemas.pdf.AdobePDFAdapter;
 import org.apache.xmlgraphics.xmp.schemas.pdf.AdobePDFSchema;
-import org.junit.Test;
+
+import org.apache.fop.pdf.PDFDocument;
+import org.apache.fop.pdf.PDFInfo;
+import org.apache.fop.pdf.PDFMetadata;
 
 /**
  * Test case for PDF/A metadata handling.
index fee2c07aa409e9cf44639bf76d2ebc686a2a84b6..bb0f2f92edf8e39df3b532e22cd123405fe6044b 100644 (file)
 
 package org.apache.fop.render.pdf;
 
-import static org.junit.Assert.assertEquals;
-
 import java.io.StringWriter;
 
-import org.apache.fop.pdf.CMapBuilder;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
+import org.apache.fop.pdf.CMapBuilder;
+
 /** Simple sanity test of the PDFCmap class */
 public class PDFCMapTestCase {
     private static final String EOL = "\n";
@@ -60,8 +61,7 @@ public class PDFCMapTestCase {
             + "end" + EOL
             + "end" + EOL
             + "%%EndResource" + EOL
-            + "%%EOF" + EOL
-        ;
+            + "%%EOF" + EOL;
 
         final StringWriter w = new StringWriter();
         final CMapBuilder builder = new CMapBuilder(w, "test");
index 34647818ab0877d135cdccb57291aa88c56fd4bd..fc6212dcdcc3587533dd95dbfa2d0d115fe3e6bc 100644 (file)
@@ -19,9 +19,6 @@
 
 package org.apache.fop.render.pdf;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.StringTokenizer;
@@ -30,6 +27,9 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.apps.FOUserAgent;
 
 /** Test that characters are correctly encoded in a generated PDF file */
index 4f3a5e6282875e1c705381524bc6fca451c32c3c..3130a73e7f88f8ea46330201ea31eab7350e805a 100644 (file)
@@ -24,12 +24,12 @@ import java.io.IOException;
 import org.junit.Before;
 import org.junit.Test;
 
-import org.apache.fop.pdf.PDFNumber;
-
 import static org.mockito.Matchers.endsWith;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
+import org.apache.fop.pdf.PDFNumber;
+
 public class PDFGraphicsPainterTestCase {
 
     private PDFGraphicsPainter sut;
index f431b3ee9c511f156c604f001ab770768f62e5c1..db175784736ab3db1c1532504bb47496454249ba 100644 (file)
@@ -24,17 +24,17 @@ import java.awt.Rectangle;
 
 import org.junit.Test;
 
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.fo.Constants;
-import org.apache.fop.render.intermediate.IFContext;
-import org.apache.fop.traits.BorderProps;
-
 import static org.mockito.Matchers.endsWith;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.render.intermediate.IFContext;
+import org.apache.fop.traits.BorderProps;
+
 public class PDFPainterTestCase {
 
     @Test
index 2d3dfb760426e39f0f76d2ae4e41d91a279c0ebc..4dd3a6610043c725cc2457cbf0e79e1886a91340 100644 (file)
@@ -21,6 +21,10 @@ package org.apache.fop.render.pdf;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
 import org.apache.fop.apps.PDFRendererConfBuilder;
 import org.apache.fop.pdf.PDFAMode;
@@ -28,10 +32,6 @@ import org.apache.fop.pdf.PDFXMode;
 import org.apache.fop.pdf.Version;
 import org.apache.fop.render.pdf.PDFRendererConfig.PDFRendererConfigParser;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 public class PDFRendererConfigParserTestCase
         extends AbstractRendererConfigParserTester<PDFRendererConfBuilder, PDFRendererConfig> {
 
index 489d4dc96904504c000284f7b34c0d9ee1c99710..699a8a186afc3ae3ea29c4b60840375ce3c2a5a0 100644 (file)
@@ -29,6 +29,8 @@ import java.util.Map;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.pdf.PDFAMode;
 import org.apache.fop.pdf.PDFEncryptionParams;
 import org.apache.fop.pdf.PDFXMode;
@@ -40,7 +42,6 @@ import static org.apache.fop.render.pdf.PDFRendererOption.OUTPUT_PROFILE;
 import static org.apache.fop.render.pdf.PDFRendererOption.PDF_A_MODE;
 import static org.apache.fop.render.pdf.PDFRendererOption.PDF_X_MODE;
 import static org.apache.fop.render.pdf.PDFRendererOption.VERSION;
-import static org.junit.Assert.assertEquals;
 
 public class PDFRendererOptionsConfigTestCase {
 
@@ -51,7 +52,7 @@ public class PDFRendererOptionsConfigTestCase {
     static {
         final EnumMap<PDFRendererOption, Object> props
         = new EnumMap<PDFRendererOption, Object>(PDFRendererOption.class);
-        for(PDFRendererOption option : PDFRendererOption.values()) {
+        for (PDFRendererOption option : PDFRendererOption.values()) {
             props.put(option, option.getDefaultValue());
         }
         DEFAULT_OPTIONS = Collections.unmodifiableMap(props);
@@ -102,7 +103,7 @@ public class PDFRendererOptionsConfigTestCase {
         assertEncryptionParamsEquals(expectedEncryptionParams, actual.getEncryptionParameters());
     }
 
-    private static void assertEncryptionParamsEquals(PDFEncryptionParams expected, 
+    private static void assertEncryptionParamsEquals(PDFEncryptionParams expected,
             PDFEncryptionParams actual) {
         assertEquals(expected == null, actual == null);
         if (actual != null) {
index d084aa618d147cb88c7cf27f73555c03c15052b9..965a8e30e7e28647b829efbab4d30836e5c3c8f0 100644 (file)
 
 package org.apache.fop.render.pdf;
 
-import static org.junit.Assert.fail;
-
 import java.io.File;
 import java.io.IOException;
 
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
+import static org.junit.Assert.fail;
+
 import org.apache.fop.apps.FOUserAgent;
 
 /**
index f41520bf3ff112e77b523b06aa38758e5dafeef3..e74251be115326a03921e7637ee9e7d5dcdbf7f6 100644 (file)
@@ -28,8 +28,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * A test suite for org.apache.fop.render.pdf.*
  */
 @RunWith(Suite.class)
-@SuiteClasses({
-        PDFRendererConfigParserTestCase.class
-})
+@SuiteClasses(PDFRendererConfigParserTestCase.class)
 public final class RenderPDFTestSuite {
 }
index dcbc2d757ac02835dabee641774b1c1603e8cde3..eb25c3f94e8fd6084fda7da2d9962bf37b57b018 100644 (file)
 
 package org.apache.fop.render.ps;
 
-import static org.junit.Assert.assertEquals;
-
 import java.io.File;
 import java.io.IOException;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.xmlgraphics.ps.PSResource;
 import org.apache.xmlgraphics.ps.dsc.DSCException;
 import org.apache.xmlgraphics.ps.dsc.DSCParser;
index 458033dad9907e923dbe59111f624d95a568daba..53654d76af2125ae399c07ad05acc79e4b5fc8ad 100644 (file)
@@ -27,17 +27,16 @@ import java.io.IOException;
 
 import org.junit.Test;
 
-import org.apache.xmlgraphics.image.loader.ImageSize;
-import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
-
-import org.apache.fop.render.RawPNGTestUtil;
-
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
-
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.apache.xmlgraphics.image.loader.ImageSize;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawPNG;
+
+import org.apache.fop.render.RawPNGTestUtil;
+
 public class ImageEncoderPNGTestCase {
 
     @Test
index ba0598b52f1f213e03b2a92408a9025d38a135d4..02e96806f87dc7140499b6b345d73eec90a8cf98 100644 (file)
 /* $Id$ */
 
 package org.apache.fop.render.ps;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.commons.io.IOUtils;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
index 79e5bd9b675a7bc5e46c4b88a092cb8259d6fe51..b678fdb4b202f6e2da6c96366c7cce9a5988aed4 100644 (file)
@@ -146,11 +146,11 @@ public class PSPainterTestCase {
         int y = 100000;
         int letterSpacing = 0;
         int wordSpacing = 0;
-        int dp[][] = {{100, 100, 0, 0}, null, null, {200, 200, -100, -100}};
-        double X = (x + dp[0][0]) / 1000.0;
-        double Y = (y - dp[0][1]) / 1000.0;
-        when(psGenerator.formatDouble(X)).thenReturn("100.100");
-        when(psGenerator.formatDouble(Y)).thenReturn("99.900");
+        int[][] dp = {{100, 100, 0, 0}, null, null, {200, 200, -100, -100}};
+        double xAsDouble = (x + dp[0][0]) / 1000.0;
+        double yAsDouble = (y - dp[0][1]) / 1000.0;
+        when(psGenerator.formatDouble(xAsDouble)).thenReturn("100.100");
+        when(psGenerator.formatDouble(yAsDouble)).thenReturn("99.900");
         String text = "Hello Mock!";
         try {
             psPainter.drawText(x, y, letterSpacing, wordSpacing, dp, text);
index fe59143b46d01a473c2025ab20e72f33def68015..45642764c3dc5e04a0dfe1165f81a4c919198314 100644 (file)
@@ -21,14 +21,14 @@ package org.apache.fop.render.ps;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.xmlgraphics.ps.PSGenerator;
 
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
 import org.apache.fop.apps.PSRendererConfBuilder;
 import org.apache.fop.render.ps.PSRendererConfig.PSRendererConfigParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class PSRendererConfigParserTestCase
         extends AbstractRendererConfigParserTester<PSRendererConfBuilder, PSRendererConfig> {
 
index 4d42a0aabd2850ad3999b1fa1f3eb865f9676672..67ba24763b6a0dd7b832816499d952e28f8cc354 100644 (file)
@@ -19,16 +19,16 @@ package org.apache.fop.render.ps;
 
 import org.junit.Test;
 
-import org.apache.fop.apps.AbstractRendererConfiguratorTest;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.apps.PSRendererConfBuilder;
-import org.apache.fop.render.ps.PSRendererConfig.PSRendererConfigParser;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.when;
 
+import org.apache.fop.apps.AbstractRendererConfiguratorTest;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.apps.PSRendererConfBuilder;
+import org.apache.fop.render.ps.PSRendererConfig.PSRendererConfigParser;
+
 public class PSRendererConfiguratorTestCase extends
         AbstractRendererConfiguratorTest<PSRendererConfigurator, PSRendererConfBuilder> {
     private PSRenderingUtil psUtil;
index 3f1088fe15219bffaada9512d9a4abf54d64ebab..0a2c895be36a5c17caaace1d402eccb7bcea4847 100644 (file)
@@ -23,13 +23,13 @@ import java.io.IOException;
 
 import org.junit.Test;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
 import org.apache.xmlgraphics.ps.PSGenerator;
 
 import org.apache.fop.render.ps.extensions.PSPageTrailerCodeBefore;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
 public class PSRenderingUtilTestCase {
 
     private final String content = "<< /MyEntry 0 >> command";
index bfdb5f968a808208dc212fca1876c244d47579a3..4f06938d20aeba0cc477c9211335e5f070d740fb 100644 (file)
 
 package org.apache.fop.render.ps;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -33,6 +28,11 @@ import java.util.Set;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.commons.io.IOUtils;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
index b48da4186104ce43216f6c0ba4893d4e99564117..29a3a7bd39f03508e0d3b78ca7d6bddb040d0f70 100644 (file)
@@ -29,6 +29,8 @@ import java.io.IOException;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.commons.io.FileUtils;
 
 import org.apache.batik.ext.awt.RadialGradientPaint;
@@ -36,8 +38,6 @@ import org.apache.batik.ext.awt.RadialGradientPaint;
 import org.apache.xmlgraphics.java2d.GraphicContext;
 import org.apache.xmlgraphics.ps.PSGenerator;
 
-import static org.junit.Assert.assertEquals;
-
 public class PSSVGGraphics2DTestCase {
 
     float cx = 841.891f;
index 283d3f4ad9daad8a103e8f2cac3e768e6fd98fb2..3a6db4396670df6ed0013eeae2c8bb0e74545fd5 100644 (file)
@@ -29,6 +29,8 @@ import java.io.IOException;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.commons.io.FileUtils;
 
 import org.apache.batik.ext.awt.LinearGradientPaint;
@@ -36,13 +38,11 @@ import org.apache.batik.ext.awt.LinearGradientPaint;
 import org.apache.xmlgraphics.java2d.GraphicContext;
 import org.apache.xmlgraphics.ps.PSGenerator;
 
-import static org.junit.Assert.assertEquals;
-
 public class PSSVGLinearGraphics2DTestCase {
     float startX = 115f;
     float endX = 15f;
     float startY = 285f;
-    float endY=15f;
+    float endY = 15f;
     float[] fractions = {0.0f, 1.0f};
 
     /**
index c5821fff15617950ac84d215826c83f16198eb63..4c3c8446e96181611fe8e9ae79d853a17b5409f3 100644 (file)
@@ -21,13 +21,14 @@ package org.apache.fop.render.rtf;
 
 import java.io.StringWriter;
 
+import org.junit.Test;
+
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
-import org.junit.Test;
 
 /**
  * Test for http://issues.apache.org/bugzilla/show_bug.cgi?id=39607
index d8296fc33a5e0c00add6dfa8fbf8acffcdc46b89..5b294bd9badcee5ea6afc071ec41ac8adedd5e06 100644 (file)
@@ -27,6 +27,6 @@ import org.junit.runners.Suite.SuiteClasses;
  * Test suite for FOP's RTF library.
  */
 @RunWith(Suite.class)
-@SuiteClasses({ Bug39607TestCase.class })
+@SuiteClasses(Bug39607TestCase.class)
 public class RichTextFormatTestSuite {
 }
index 07085059dc571008dfe7c971a5b0d89affa98645..9df1c26ef37b3bcf60e385e792370db56cce8f93 100644 (file)
 
 package org.apache.fop.render.rtf.rtflib.testdocs;
 
+import java.io.IOException;
+
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHyperLink;
-
-import java.io.IOException;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 
 /**
  * Class <code>BasicLink</code> here.
- *
- * @author <a href="mailto:mks@ANDREAS">Andreas Putz</a>
  */
 
 public class BasicLink extends TestDocument {
index 16460cd1ce43d0cbe17d55d9258e7ca58628ac2f..7f17514ef5d680229406c90f6d44ca434c92187c 100644 (file)
@@ -29,11 +29,8 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 
 import java.io.File;
 import java.io.IOException;
-//import org.apache.fop.render.rtf.rtflib.jfor.main.JForVersionInfo;
 
 /**  Create test RTF documents from classes found in this package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- *  @author Andreas Putz a.putz@skynamics.com
  */
 
 public class CreateTestDocuments {
index 3329b26b9f4e3744ea7b780a8f496b34c58c3cb5..1af4c7bedb99fc1559596078ba967198759b9853 100644 (file)
@@ -33,8 +33,6 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableColumnsInfo;
  *  to create documents without worrying about nested tables handling.
  *  Might need to be replaced by more complete version in some sample
  *  documents created by this package.
- *
- *  @author bdelacretaz@codeconsult.ch
  */
 
 class DummyTableColumnsInfo implements ITableColumnsInfo {
index b957bc1faf1220865e355b5a59a8f33561a42295..1127f3e724485ebccc944a485f08f7af31ab65ed 100644 (file)
 
 package org.apache.fop.render.rtf.rtflib.testdocs;
 
+import java.io.IOException;
+
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
-
-import java.io.IOException;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 /**
  * Generate a test document containing external graphics.
- *
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
  */
 class ExternalGraphic extends TestDocument {
     private String file = "file:///tmp/jfor-images/logo.";
index 3ce05c606421b579e722b44642cfd541fc7a87f4..6f4e27a596d7d708eaa146f06c4dc72d32630cd5 100644 (file)
@@ -30,13 +30,13 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 import java.io.IOException;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
  */
index f1817bf03ddea78cddf695bb39b8058683b62919..9be5e899a2811988104131002ef6a8c8d271156b 100644 (file)
@@ -32,11 +32,10 @@ import java.io.IOException;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 
 /**  Generates an RTF test document containing merged table cells
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 class MergedTableCells extends TestDocument {
index 72dad7e984c46496e33af2b65ed3108c77c7325e..c11fbc334f3b834d1be91b7bb7d6b2f859ad03d0 100644 (file)
@@ -30,14 +30,13 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 import java.io.IOException;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 
 /**  Generates an RTF document to test nested tables with the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 class NestedTable extends TestDocument {
index 2b38aa789be24e066b602a2811ba2dd22d2a2a89..edce3264a718f0b2d4e775d341092ef0be100558 100644 (file)
 
 package org.apache.fop.render.rtf.rtflib.testdocs;
 
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 public class ParagraphAlignment extends TestDocument {
 
index 2ca16c0e5947e08b688735858cc4da27d1842263..ca6ce79bc3886b6b2e161a1a407f9846ff0dedef 100644 (file)
@@ -30,11 +30,10 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 import java.io.IOException;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 class SimpleDocument
index eff3aa7ff4e8f99063a701a89959f2e81ee17594..e817f6a135d4d5238746de7381cf1b3df86d0075 100644 (file)
@@ -30,15 +30,14 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 import java.io.IOException;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListStyle;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListStyleNumber;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 class SimpleLists extends TestDocument {
index cf84b3ec4a7f90a7393cc61033e5ad705e59ad4a..10ddc11e714f1d60f2de25439b9d7f8e14051581 100644 (file)
@@ -32,11 +32,10 @@ import java.io.IOException;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 class SimpleTable extends TestDocument {
     /** generate the body of the test document */
index 5274dc32e2931e925e0f32c0d51bda31f78809fa..266903766a218f8b1ed162438fe68ad535c7777e 100644 (file)
 
 package org.apache.fop.render.rtf.rtflib.testdocs;
 
-import java.util.Date;
 import java.io.File;
-import java.io.IOException;
 import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
-//import org.apache.fop.render.rtf.rtflib.jfor.main.JForVersionInfo;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 
 /**  Base class for generating RTF documents used to test the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 abstract class TestDocument {
index 4ab48acb0e434f304cf22e1a13c530a8cbec6325..bb0614cee07fcc5e34d984a03e9434727fee7e2e 100644 (file)
@@ -29,14 +29,13 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 
 import java.io.IOException;
 
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 
 /**  Generates a simple RTF test document for the jfor rtflib package.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 class TextAttributes extends TestDocument {
index 4359822f65139f14e0cc7a606f01c6442303dfe4..a206e014fbaf7369525892c4e996a23fa79e1992 100644 (file)
@@ -30,11 +30,10 @@ package org.apache.fop.render.rtf.rtflib.testdocs;
 import java.io.IOException;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 
 /**  Generates an RTF document to test the WhitespaceCollapser
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
 class Whitespace extends TestDocument {
index a7ae52c651311c5c581dcec8f59bdabe0a36377c..30fed05ea8d189f87000854702d2243c725ea174 100644 (file)
@@ -21,13 +21,12 @@ package org.apache.fop.render.txt;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.fop.apps.AbstractRendererConfigParserTester;
 import org.apache.fop.apps.TxtRendererConfBuilder;
-import org.apache.fop.render.RendererConfig.RendererConfigParser;
-import org.apache.fop.render.txt.TxtRendererConfig.TxtRendererOption;
 import org.apache.fop.render.txt.TxtRendererConfig.TxtRendererConfigParser;
-
-import static org.junit.Assert.assertEquals;
+import org.apache.fop.render.txt.TxtRendererConfig.TxtRendererOption;
 
 public class TxtRendererConfigParserTestCase
         extends AbstractRendererConfigParserTester<TxtRendererConfBuilder, TxtRendererConfig> {
index 42ca8dee6983667b22a669c8058f91892e1c68d7..d8813c3bc66bb48eeec4cb88bb2df806c853ceb9 100644 (file)
 
 package org.apache.fop.text.linebreak;
 
-import static org.junit.Assert.assertTrue;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
 
 /**
  * JUnit test case for the LineBreakStatus class
index 015c1846f87ac4b5e85a5a0c5f065f2a62bc4be8..5fc5c7d5099d8ece5f874608e93e1d158b93c40e 100644 (file)
 
 package org.apache.fop.text.linebreak;
 
-import static org.junit.Assert.assertEquals;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * TODO add javadoc
  *
index 04fed19ba7856c6f87d2dcbb78a22baee56adfc5..721830aee172fadf2c78ffd6f108623aef4bea16 100644 (file)
@@ -81,8 +81,8 @@ public class FOProcessorImpl extends AbstractLogEnabled
         }
     }
 
-    /** {@inheritDoc} 
-     * @throws URISyntaxException 
+    /** {@inheritDoc}
+     * @throws URISyntaxException
      * @throws SAXException */
     public void process(Source src, Templates templates, OutputStream out)
             throws java.io.IOException, URISyntaxException, SAXException {
index 7ff0cec4f0ee0eaefdbd11973c56dbd349e4f86d..d18ae405a8a166083b5ad815806c6dd490f78742 100644 (file)
@@ -32,7 +32,10 @@ import org.apache.avalon.framework.logger.ConsoleLogger;
 /**
  * Starter class for the multi-threading testbed.
  */
-public class Main {
+public final class Main {
+
+    private Main() {
+    }
 
     private static void prompt() throws IOException {
         BufferedReader in = new BufferedReader(new java.io.InputStreamReader(System.in));
index ec93d708e42ea657eefaf4cef9cd6cfd0b4dfee1..692e3059fe7a18d82292b3be8705cc2e6a679b60 100644 (file)
@@ -23,14 +23,14 @@ import java.awt.Color;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives;
 import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace;
 
 import org.apache.fop.fo.Constants;
 import org.apache.fop.util.ColorUtil;
 
-import static org.junit.Assert.assertEquals;
-
 /**
  * Tests the BorderProps class.
  */
@@ -67,7 +67,7 @@ public class BorderPropsTestCase {
         Color col = new Color(1.0f, 1.0f, 0.5f, 1.0f);
         //Normalize: Avoid false alarms due to color conversion (rounding)
         col = ColorUtil.parseColorString(null, ColorUtil.colorToString(col));
-        for(BorderProps.Mode mode : BorderProps.Mode.values()) {
+        for (BorderProps.Mode mode : BorderProps.Mode.values()) {
             BorderProps sut = BorderProps.makeRectangular(Constants.EN_SOLID, 10, col, mode);
             testSerialization(sut);
             sut = new BorderProps(Constants.EN_SOLID, 10, 4, 3, col, mode);
index 73465fdcc55683d0c8054371a3b887ece5168ef3..ba686278556e4eb885f6478e06e6fe64600fcb8c 100644 (file)
 
 package org.apache.fop.traits;
 
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import org.junit.Test;
-
 /**
  * Tests the {@link MinOptMax} class.
  */
index c4b9446acea20d63ffbc26e9e773acdfaf1472eb..5e75f2563af37cb2f60043ff6479d63a9ae22a06 100644 (file)
 
 package org.apache.fop.util;
 
-import static org.junit.Assert.assertEquals;
-
 import java.util.Map;
 
-import org.apache.fop.events.model.EventSeverity;
-import org.apache.fop.util.text.AdvancedMessageFormat;
 import org.junit.Test;
 import org.xml.sax.helpers.LocatorImpl;
 
+import static org.junit.Assert.assertEquals;
+
+import org.apache.fop.events.model.EventSeverity;
+import org.apache.fop.util.text.AdvancedMessageFormat;
+
 /**
  * Tests for EventFormatter.
  */
index 3afcc3a2e3f3ec1816c1899b2e925ef14980a454..8bda997850374c1f010013271fe7beabd2b9bccf 100644 (file)
@@ -19,8 +19,6 @@
 
 package org.apache.fop.util;
 
-import static org.junit.Assert.assertEquals;
-
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Graphics2D;
@@ -31,13 +29,18 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringWriter;
 
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
 import org.apache.commons.io.IOUtils;
-import org.apache.fop.util.bitmap.BitmapImageUtil;
-import org.apache.fop.util.bitmap.MonochromeBitmapConverter;
+
 import org.apache.xmlgraphics.image.writer.ImageWriterUtil;
 import org.apache.xmlgraphics.util.WriterOutputStream;
 import org.apache.xmlgraphics.util.io.ASCIIHexOutputStream;
-import org.junit.Test;
+
+import org.apache.fop.util.bitmap.BitmapImageUtil;
+import org.apache.fop.util.bitmap.MonochromeBitmapConverter;
 
 /**
  * Tests {@link BitmapImageUtil}.
index 6e65004a377bfed72dfb5ee794f7fec634279817..c86ebbeacdea7902fe1bef5a5140d57d9e625c78 100644 (file)
@@ -26,6 +26,11 @@ import java.net.URI;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.xmlgraphics.java2d.color.ColorSpaces;
 import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives;
 import org.apache.xmlgraphics.java2d.color.NamedColorSpace;
@@ -34,11 +39,6 @@ import org.apache.xmlgraphics.java2d.color.RenderingIntent;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.FopFactory;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 /**
  * Tests the ColorUtil class.
  */
index 94e8d67d241a9f2e2aecd0abc6b8a36d05c80d55..9e62fdc1c9c1c68894441977df14714fd4c74d6f 100644 (file)
@@ -95,9 +95,6 @@ public class DigestFilter extends XMLFilterImpl {
         super.endDocument();
     }
 
-    /* (non-Javadoc)
-     * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-     */
     public void startElement(
         String url,
         String localName,
index 342488a93228609044d2cfc384904204a552df24..5e4f38b0b42bfcef9967e6fe364d82d29f7f3f01 100644 (file)
 
 package org.apache.fop.util;
 
+import java.util.LinkedList;
+
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
-import java.util.LinkedList;
-
 import org.apache.fop.layoutmgr.ElementListUtils;
 import org.apache.fop.layoutmgr.KnuthBox;
 import org.apache.fop.layoutmgr.KnuthElement;
 import org.apache.fop.layoutmgr.KnuthGlue;
 import org.apache.fop.layoutmgr.KnuthPenalty;
-import org.junit.Test;
 
 /**
  * Test class for ElementListUtils.
index f7383c720606d2b5f17abcf31b0474d268902a8f..91861dcc6d03c24fc542d865fe823aa50dda7226 100644 (file)
 
 package org.apache.fop.util;
 
-import static org.junit.Assert.assertEquals;
-
 import java.util.Locale;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Tests {@link LanguageTags}.
  */
index 26cfa4406c4e7a5a8436b68ff5c3c2af60a460e4..60aa16d83c44f51d22262eab25e41712c4f72371 100644 (file)
 
 package org.apache.fop.util;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 /**
  * Tests for XMLResourceBundle.
  */
index e0c1d5bd4cee4450fa5780cd429f81928f9e07b4..f2157176bd4d913814fc92d93628ca75e46d4ba3 100644 (file)
@@ -30,11 +30,12 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 
+import org.apache.commons.io.IOUtils;
+
 import org.apache.batik.ext.awt.image.GraphicsUtil;
 import org.apache.batik.ext.awt.image.renderable.Filter;
 import org.apache.batik.ext.awt.image.spi.ImageTagRegistry;
 import org.apache.batik.util.ParsedURL;
-import org.apache.commons.io.IOUtils;
 
 /**
  * Helper class to visually compare two bitmap images.
@@ -45,7 +46,11 @@ import org.apache.commons.io.IOUtils;
  * <p>
  * TODO Move as utility class to XML Graphics Commons when possible
  */
-public class BitmapComparator {
+public final class BitmapComparator {
+
+
+    private BitmapComparator() {
+    }
 
     /**
      * Builds a new BufferedImage that is the difference between the two input images
@@ -79,15 +84,14 @@ public class BitmapComparator {
         int w = ref.getWidth();
         int h = ref.getHeight();
 
-        int y, i, val;
         int [] refPix = null;
         int [] genPix = null;
-        for (y = 0; y < h; y++) {
-            refPix = refWR.getPixels (0, y, w, 1, refPix);
-            genPix = genWR.getPixels (0, y, w, 1, genPix);
-            for (i = 0; i < refPix.length; i++) {
+        for (int y = 0; y < h; y++) {
+            refPix = refWR.getPixels(0, y, w, 1, refPix);
+            genPix = genWR.getPixels(0, y, w, 1, genPix);
+            for (int i = 0; i < refPix.length; i++) {
                 // val = ((genPix[i] - refPix[i]) * 5) + 128;
-                val = ((refPix[i] - genPix[i]) * 10) + 128;
+                int val = ((refPix[i] - genPix[i]) * 10) + 128;
                 if ((val & 0xFFFFFF00) != 0) {
                     if ((val & 0x80000000) != 0) {
                         val = 0;
index e83322f90f599f7231ecab92437531fc4dcf0259..aa4dadf47eef138b26f601212bdcf99545cab6b7 100644 (file)
@@ -27,7 +27,10 @@ import org.apache.commons.logging.Log;
 /**
  * Utilities for converting files with external converters.
  */
-public class ConvertUtils {
+public final class ConvertUtils {
+
+    private ConvertUtils() {
+    }
 
     /**
      * Calls an external converter application (GhostScript, for example).