diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2014-07-18 14:21:06 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2014-07-18 14:21:06 +0000 |
commit | 7f21c0ae8547429472f10bfd297294d6248b41b6 (patch) | |
tree | c371ab7720164ec30528fe5e7e84e71e5b149edc /test/java/org/apache/fop | |
parent | f8dd309bf637ecd62762fdfd889be1e7b210b755 (diff) | |
parent | d8823a706376a572303ab86004c7370b12ef7d85 (diff) | |
download | xmlgraphics-fop-7f21c0ae8547429472f10bfd297294d6248b41b6.tar.gz xmlgraphics-fop-7f21c0ae8547429472f10bfd297294d6248b41b6.zip |
Merged latest trunk
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1611658 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop')
6 files changed, 10 insertions, 21 deletions
diff --git a/test/java/org/apache/fop/DebugHelper.java b/test/java/org/apache/fop/DebugHelper.java index 9ee7de072..1fb7074ee 100644 --- a/test/java/org/apache/fop/DebugHelper.java +++ b/test/java/org/apache/fop/DebugHelper.java @@ -30,7 +30,7 @@ public final class DebugHelper { private DebugHelper() { } - private static boolean elObserversRegistered = false; + private static boolean elObserversRegistered; /** * Registers the default element list observers used for debugging. diff --git a/test/java/org/apache/fop/fonts/truetype/OTFFileTestCase.java b/test/java/org/apache/fop/fonts/truetype/OTFFileTestCase.java index b4e2cee2e..39b6fd50f 100644 --- a/test/java/org/apache/fop/fonts/truetype/OTFFileTestCase.java +++ b/test/java/org/apache/fop/fonts/truetype/OTFFileTestCase.java @@ -30,9 +30,9 @@ import static org.junit.Assert.assertTrue; public class OTFFileTestCase { protected OTFFile sourceSansProBold; - protected FontFileReader sourceSansReader = null; + protected FontFileReader sourceSansReader; protected OTFFile alexBrush; - protected FontFileReader alexBrushReader = null; + protected FontFileReader alexBrushReader; /** * Initializes fonts used for the testing of reading OTF CFF diff --git a/test/java/org/apache/fop/fonts/type1/Type1SubsetFileTestCase.java b/test/java/org/apache/fop/fonts/type1/Type1SubsetFileTestCase.java index e18173a6b..3d7093bd3 100644 --- a/test/java/org/apache/fop/fonts/type1/Type1SubsetFileTestCase.java +++ b/test/java/org/apache/fop/fonts/type1/Type1SubsetFileTestCase.java @@ -54,7 +54,7 @@ public class Type1SubsetFileTestCase { @Test public void test() throws IOException { InputStream in = new FileInputStream(TEST_FONT_A); - compareCharStringData(in, TEST_FONT_A, createFontASubset(in, TEST_FONT_A)); + compareCharStringData(TEST_FONT_A, createFontASubset(in, TEST_FONT_A)); } @Test @@ -135,12 +135,12 @@ public class Type1SubsetFileTestCase { assertEquals(segment[3], 65); } - private void compareCharStringData(InputStream in, String font, byte[] subsetFont) + private void compareCharStringData(String font, byte[] subsetFont) throws IOException { decodedSections = new ArrayList<byte[]>(); //Reinitialise the input stream as reset only supports 1000 bytes. - in = new FileInputStream(font); + InputStream in = new FileInputStream(font); List<PSElement> origElements = parseElements(in); List<PSElement> subsetElements = parseElements(new ByteArrayInputStream(subsetFont)); @@ -173,8 +173,6 @@ public class Type1SubsetFileTestCase { SingleByteFont sbfont = mock(SingleByteFont.class); //Glyph index & selector Map<Integer, Integer> glyphs = new HashMap<Integer, Integer>(); - //Selector & unicode - Map<Integer, Character> usedCharsIndex = new HashMap<Integer, Character>(); Map<Integer, String> usedCharNames = new HashMap<Integer, String>(); int count = 0; for (int i = 32; i < 127; i++) { @@ -185,7 +183,6 @@ public class Type1SubsetFileTestCase { } for (int i = 161; i < 204; i++) { glyphs.put(i, count++); - usedCharsIndex.put(count, (char)i); when(sbfont.getUnicodeFromSelector(count)).thenReturn((char)i); usedCharNames.put(i, String.format("/%s", Glyphs.charToGlyphName((char)i))); when(sbfont.getGlyphName(i)).thenReturn(AdobeStandardEncoding.getCharFromCodePoint(i)); @@ -195,14 +192,12 @@ public class Type1SubsetFileTestCase { }; for (int i = 0; i < randomGlyphs.length; i++) { glyphs.put(randomGlyphs[i], count++); - usedCharsIndex.put(count, (char)randomGlyphs[i]); when(sbfont.getUnicodeFromSelector(count)).thenReturn((char)randomGlyphs[i]); usedCharNames.put(i, String.format("/%s", Glyphs.charToGlyphName((char)i))); when(sbfont.getGlyphName(i)).thenReturn(AdobeStandardEncoding.getCharFromCodePoint(i)); } for (int i = 256; i < 335; i++) { glyphs.put(i, count++); - usedCharsIndex.put(count, (char)i); when(sbfont.getUnicodeFromSelector(count)).thenReturn((char)i); usedCharNames.put(i, String.format("/%s", Glyphs.charToGlyphName((char)i))); when(sbfont.getGlyphName(i)).thenReturn(AdobeStandardEncoding.getCharFromCodePoint(i)); @@ -211,7 +206,7 @@ public class Type1SubsetFileTestCase { when(sbfont.getUsedGlyphs()).thenReturn(glyphs); when(sbfont.getEmbedFileURI()).thenReturn(URI.create(font)); Type1SubsetFile subset = new Type1SubsetFile(); - return subset.createSubset(in, sbfont, "AAAAAA"); + return subset.createSubset(in, sbfont); } private List<PSElement> parseElements(InputStream in) @@ -235,7 +230,6 @@ public class Type1SubsetFileTestCase { private byte[] readFullCharString(byte[] decoded, byte[] data, PSFixedArray subroutines) { List<BytesNumber> operands = new ArrayList<BytesNumber>(); - List<BytesNumber> fullList = new ArrayList<BytesNumber>(); for (int i = 0; i < data.length; i++) { int cur = data[i] & 0xFF; if (cur >= 0 && cur <= 31) { @@ -256,20 +250,16 @@ public class Type1SubsetFileTestCase { } BytesNumber operand = new BytesNumber(cur, i); operand.setName(getName(cur, next)); - fullList.add(operand); } operands.clear(); } if (cur >= 32 && cur <= 246) { operands.add(new BytesNumber(cur - 139, 1)); - fullList.add(operands.get(operands.size() - 1)); } else if (cur >= 247 && cur <= 250) { operands.add(new BytesNumber((cur - 247) * 256 + (data[i + 1] & 0xFF) + 108, 2)); - fullList.add(operands.get(operands.size() - 1)); i++; } else if (cur >= 251 && cur <= 254) { operands.add(new BytesNumber(-(cur - 251) * 256 - (data[i + 1] & 0xFF) - 108, 2)); - fullList.add(operands.get(operands.size() - 1)); i++; } else if (cur == 255) { int b1 = data[i + 1] & 0xFF; @@ -278,7 +268,6 @@ public class Type1SubsetFileTestCase { int b4 = data[i + 4] & 0xFF; int value = b1 << 24 | b2 << 16 | b3 << 8 | b4; operands.add(new BytesNumber(value, 5)); - fullList.add(operands.get(operands.size() - 1)); i += 4; } } diff --git a/test/java/org/apache/fop/fotreetest/ResultCollector.java b/test/java/org/apache/fop/fotreetest/ResultCollector.java index d5b362704..948b856bf 100644 --- a/test/java/org/apache/fop/fotreetest/ResultCollector.java +++ b/test/java/org/apache/fop/fotreetest/ResultCollector.java @@ -28,7 +28,7 @@ import java.util.List; */ public class ResultCollector { - private static ResultCollector instance = null; + private static ResultCollector instance; private List<String> results = new ArrayList<String>(); diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestUtils.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestUtils.java index 963b66dff..2649838f4 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestUtils.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestUtils.java @@ -59,7 +59,7 @@ public final class LayoutEngineTestUtils { private static class FilenameHandler extends DefaultHandler { private StringBuffer buffer = new StringBuffer(128); - private boolean readingFilename = false; + private boolean readingFilename; private List<String> filenames; public FilenameHandler(List<String> filenames) { diff --git a/test/java/org/apache/fop/threading/FOPTestbed.java b/test/java/org/apache/fop/threading/FOPTestbed.java index f015479c7..7b08b7cd1 100644 --- a/test/java/org/apache/fop/threading/FOPTestbed.java +++ b/test/java/org/apache/fop/threading/FOPTestbed.java @@ -59,7 +59,7 @@ public class FOPTestbed extends AbstractLogEnabled private Processor foprocessor; private boolean writeToDevNull; - private int counter = 0; + private int counter; private List results = Collections.synchronizedList(new java.util.LinkedList()); |