Author: vhennebert
Date: Mon May 28 15:50:35 2012
New Revision: 1343299

URL: http://svn.apache.org/viewvc?rev=1343299&view=rev
Log:
Bugzilla #53296: Updated TTFinPS specific test cases to JUnit 4
Patch by Robert Meyer, applied with minor modifications

Added:
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java
      - copied, changed from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/ttf/DroidSansMono.LICENSE
      - copied unchanged from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/DroidSansMono.LICENSE
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/ttf/DroidSansMono.ttf
   (with props)
Removed:
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/EncodingModeTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTest.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/DroidSansMono.LICENSE
Modified:
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java
    
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/util/HexEncoderTestCase.java

Modified: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/EncodingModeTestCase.java?rev=1343299&r1=1343298&r2=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/EncodingModeTestCase.java
 Mon May 28 15:50:35 2012
@@ -23,6 +23,9 @@ import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 
+/**
+ * Tests {@link EncodingMode}.
+ */
 public class EncodingModeTestCase {
 
     @Test
@@ -38,4 +41,9 @@ public class EncodingModeTestCase {
         assertEquals(EncodingMode.SINGLE_BYTE, 
EncodingMode.getValue("single-byte"));
         assertEquals(EncodingMode.CID, EncodingMode.getValue("cid"));
     }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void getValueMustCheckForIllegalArguments() {
+        EncodingMode.getValue("fail");
+    }
 }

Modified: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java?rev=1343299&r1=1343298&r2=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/FOPFontsTestSuite.java
 Mon May 28 15:50:35 2012
@@ -19,36 +19,24 @@
 
 package org.apache.fop.fonts;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
-import org.apache.fop.fonts.truetype.FontFileReaderTest;
-import org.apache.fop.fonts.truetype.TTFFileTest;
-import org.apache.fop.fonts.truetype.TTFSubSetFileTest;
-import org.apache.fop.fonts.truetype.TTFTableNameTest;
+import org.apache.fop.fonts.truetype.FontFileReaderTestCase;
+import org.apache.fop.fonts.truetype.TTFFileTestCase;
+import org.apache.fop.fonts.truetype.TTFSubSetFileTestCase;
+import org.apache.fop.fonts.truetype.TTFTableNameTestCase;
 
 /**
  * A test suite designed for org.apache.fop.fonts.*
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+        EncodingModeTestCase.class,
+        FontFileReaderTestCase.class,
+        TTFFileTestCase.class,
+        TTFSubSetFileTestCase.class,
+        TTFTableNameTestCase.class })
 public final class FOPFontsTestSuite {
-    /**
-     * Constructor
-     */
-    private FOPFontsTestSuite() {
-    }
-    /**
-     * Testing org.apache.fop.fonts.*
-     * @return test
-     */
-    public static Test suite() {
-        TestSuite testSuite = new TestSuite("Test suite for FOPs fonts 
classes");
-        //$JUnit-BEGIN$
-        testSuite.addTest(new TestSuite(EncodingModeTest.class));
-        testSuite.addTest(new TestSuite(FontFileReaderTest.class));
-        testSuite.addTest(new TestSuite(TTFFileTest.class));
-        testSuite.addTest(new TestSuite(TTFSubSetFileTest.class));
-        testSuite.addTest(new TestSuite(TTFTableNameTest.class));
-        //$JUnit-END$
-        return testSuite;
-    }
 }

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/FontFileReaderTestCase.java
 Mon May 28 15:50:35 2012
@@ -25,12 +25,17 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Arrays;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 /**
  * A test class for org.apache.fop.truetype.FontFileReader
  */
-public class FontFileReaderTest extends TestCase {
+public class FontFileReaderTestCase {
     private FontFileReader fontReader;
     private final InputStream in;
     private final byte[] byteArray;
@@ -39,7 +44,7 @@ public class FontFileReaderTest extends 
      * Constructor - initialises an array that only needs to be created once. 
It creates a byte[]
      * of form { 0x00, 0x01, 0x02, 0x03..., 0xff};
      */
-    public FontFileReaderTest() {
+    public FontFileReaderTestCase() {
         byteArray = new byte[256];
         for (int i = 0; i < 256; i++) {
             byteArray[i] = (byte) i;
@@ -50,6 +55,7 @@ public class FontFileReaderTest extends 
     /**
      * sets up the test subject object for testing.
      */
+    @Before
     public void setUp() {
         try {
             fontReader = new FontFileReader(in);
@@ -70,6 +76,7 @@ public class FontFileReaderTest extends 
      * Test readTTFByte()
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFByte() throws IOException {
         for (int i = 0; i < 256; i++) {
             assertEquals((byte) i, fontReader.readTTFByte());
@@ -80,6 +87,7 @@ public class FontFileReaderTest extends 
      * Test seekSet() - check that it moves to the correct position and 
enforce a failure case.
      * @throws IOException exception
      */
+    @Test
     public void testSeekSet() throws IOException {
         fontReader.seekSet(10);
         assertEquals(10, fontReader.readTTFByte());
@@ -95,6 +103,7 @@ public class FontFileReaderTest extends 
      * Test skip() - check that it moves to the correct position and enforce a 
failure case.
      * @throws IOException exception
      */
+    @Test
     public void testSkip() throws IOException {
         fontReader.skip(100);
         assertEquals(100, fontReader.readTTFByte());
@@ -114,6 +123,7 @@ public class FontFileReaderTest extends 
      * 3) test with a readTTFByte() (this moves the position by the size of 
the data being read)
      * @throws IOException exception
      */
+    @Test
     public void testGetCurrentPos() throws IOException {
         fontReader.seekSet(10);
         fontReader.skip(100);
@@ -125,6 +135,7 @@ public class FontFileReaderTest extends 
     /**
      * Test getFileSize()
      */
+    @Test
     public void testGetFileSize() {
         assertEquals(256, fontReader.getFileSize());
     }
@@ -133,6 +144,7 @@ public class FontFileReaderTest extends 
      * Test readTTFUByte()
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFUByte() throws IOException {
         for (int i = 0; i < 256; i++) {
             assertEquals(i, fontReader.readTTFUByte());
@@ -143,6 +155,7 @@ public class FontFileReaderTest extends 
      * Test readTTFShort() - Test positive and negative numbers (two's 
compliment).
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFShort() throws IOException {
         // 0x0001 = 1
         assertEquals("Should have been 1 (0x0001)", 1, 
fontReader.readTTFShort());
@@ -158,6 +171,7 @@ public class FontFileReaderTest extends 
      * Test readTTFUShort() - Test positive and potentially negative numbers 
(two's compliment).
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFUShort() throws IOException {
         // 0x0001
         assertEquals(1, fontReader.readTTFUShort());
@@ -174,6 +188,7 @@ public class FontFileReaderTest extends 
      * and in both cases ensure that our current position isn't changed.
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFShortWithArg() throws IOException {
         // 0x6465
         assertEquals(25701, fontReader.readTTFShort(100));
@@ -190,6 +205,7 @@ public class FontFileReaderTest extends 
      * position and in both cases ensure that our current position isn't 
changed.
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFUShortWithArg() throws IOException {
         // 0x6465
         assertEquals(25701, fontReader.readTTFUShort(100));
@@ -205,6 +221,7 @@ public class FontFileReaderTest extends 
      * Test readTTFLong()
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFLong() throws IOException {
         // 0x00010203
         assertEquals(66051, fontReader.readTTFLong());
@@ -218,6 +235,7 @@ public class FontFileReaderTest extends 
      * Test readTTFULong()
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFULong() throws IOException {
         // 0x00010203
         assertEquals(66051, fontReader.readTTFULong());
@@ -233,6 +251,7 @@ public class FontFileReaderTest extends 
      * 2) A string not terminated with a null (we expect this to throw an 
EOFException)
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFString() throws IOException {
         byte[] strByte = {(byte)'t', (byte)'e', (byte)'s', (byte)'t', 0x00};
         fontReader = new FontFileReader(new ByteArrayInputStream(strByte));
@@ -252,6 +271,7 @@ public class FontFileReaderTest extends 
      * Test readTTFString(int arg)
      * @throws IOException exception
      */
+    @Test
     public void testReadTTFStringIntArg() throws IOException {
         byte[] strByte = {(byte)'t', (byte)'e', (byte)'s', (byte)'t'};
         fontReader = new FontFileReader(new ByteArrayInputStream(strByte));
@@ -276,6 +296,7 @@ public class FontFileReaderTest extends 
      * Test getBytes()
      * @throws IOException exception
      */
+    @Test
     public void testGetBytes() throws IOException {
         byte[] retrievedBytes = fontReader.getBytes(0, 256);
         assertTrue(Arrays.equals(byteArray, retrievedBytes));

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java
 Mon May 28 15:50:35 2012
@@ -22,14 +22,18 @@ package org.apache.fop.fonts.truetype;
 import java.io.IOException;
 import java.util.Map;
 
-import junit.framework.TestCase;
+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.fonts.truetype.TTFFile.PostScriptVersion;
 
 /**
  * Class for testing org.apache.fop.fonts.truetype.TTFFile
  */
-public class TTFFileTest extends TestCase {
+public class TTFFileTestCase {
     // We only want to initialize the FontFileReader once (for performance 
reasons)
     /** The truetype font file (DejaVuLGCSerif) */
     protected final TTFFile dejavuTTFFile;
@@ -45,12 +49,12 @@ public class TTFFileTest extends TestCas
      * Constructor initialises FileFontReader to
      * @throws IOException exception
      */
-    public TTFFileTest() throws IOException {
+    public TTFFileTestCase() throws IOException {
         dejavuTTFFile = new TTFFile();
-        dejavuReader = new 
FontFileReader("test/resources/fonts/DejaVuLGCSerif.ttf");
+        dejavuReader = new 
FontFileReader("test/resources/fonts/ttf/DejaVuLGCSerif.ttf");
         dejavuTTFFile.readFont(dejavuReader);
         droidmonoTTFFile = new TTFFile();
-        droidmonoReader = new 
FontFileReader("test/resources/fonts/DroidSansMono.ttf");
+        droidmonoReader = new 
FontFileReader("test/resources/fonts/ttf/DroidSansMono.ttf");
         droidmonoTTFFile.readFont(droidmonoReader);
     }
 
@@ -58,6 +62,7 @@ public class TTFFileTest extends TestCas
      * Test convertTTFUnit2PDFUnit() - The units per em retrieved reading the 
HEAD table from
      * the font file. (DroidSansMono has the same units per em as DejaVu so no 
point testing it)
      */
+    @Test
     public void testConvertTTFUnit2PDFUnit() {
         // DejaVu has 2048 units per em (PDF works in millipts, thus the 1000)
         // test rational number
@@ -77,6 +82,7 @@ public class TTFFileTest extends TestCas
      * Test checkTTC()
      * @throws IOException exception
      */
+    @Test
     public void testCheckTTC() throws IOException {
         // DejaVu is not a TTC, thus this returns true
         assertTrue(dejavuTTFFile.checkTTC(""));
@@ -90,6 +96,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getAnsiKerning() - Tests values retrieved from the kern table in 
the font file.
      */
+    @Test
     public void testGetAnsiKerning() {
         Map<Integer, Map<Integer, Integer>> ansiKerning = 
dejavuTTFFile.getKerning();
         if (ansiKerning.isEmpty()) {
@@ -116,6 +123,7 @@ public class TTFFileTest extends TestCas
      * 3) The caps height in the OS/2 table
      * Tests values retrieved from analysing the font file.
      */
+    @Test
     public void testGetCapHeight() {
         // DejaVu doesn't have the PCLT table and so these have to be guessed
         // The height is approximated to be the height of the "H" which for
@@ -130,6 +138,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getCharSetName() - check that it returns "WinAnsiEncoding".
      */
+    @Test
     public void testGetCharSetName() {
         assertTrue("WinAnsiEncoding".equals(dejavuTTFFile.getCharSetName()));
         
assertTrue("WinAnsiEncoding".equals(droidmonoTTFFile.getCharSetName()));
@@ -139,6 +148,7 @@ public class TTFFileTest extends TestCas
      * Test getCharWidth() - Test values retrieved from the metrics in the 
glyf table in
      * the font file.
      */
+    @Test
     public void testGetCharWidth() {
         // Arbitrarily test a few values:
         // The width of "H" (Unicode index 0x0048) is 1786
@@ -164,6 +174,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getFamilyNames() - Test value retrieved from the name table in the 
font file.
      */
+    @Test
     public void testGetFamilyNames() {
         assertEquals(1, dejavuTTFFile.getFamilyNames().size());
         for (String name : dejavuTTFFile.getFamilyNames()) {
@@ -178,6 +189,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getFirstChar() - TODO: implement a more intelligent test here.
      */
+    @Test
     public void testGetFirstChar() {
         // Not really sure how to test this intelligently
         assertEquals(0, dejavuTTFFile.getFirstChar());
@@ -187,6 +199,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getFlags() - Test values retrieved from the POST table in the font 
file.
      */
+    @Test
     public void testGetFlags() {
         /* DejaVu flags are:
          * italic angle = 0
@@ -214,6 +227,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getFontBBox() - Test values retrieved from values in the HEAD 
table in the font file.
      */
+    @Test
     public void testGetFontBBox() {
         int[] bBox = dejavuTTFFile.getFontBBox();
         /*
@@ -238,6 +252,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getFullName() - Test value retrieved from the name table in the 
font file.
      */
+    @Test
     public void testGetFullName() {
         assertEquals("DejaVu LGC Serif", dejavuTTFFile.getFullName());
         assertEquals("Droid Sans Mono", droidmonoTTFFile.getFullName());
@@ -246,6 +261,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getGlyphName - Test value retrieved from the POST table in the 
font file.
      */
+    @Test
     public void testGetGlyphName() {
         assertEquals("H", dejavuTTFFile.getGlyphName(43));
         assertEquals("H", droidmonoTTFFile.getGlyphName(43));
@@ -254,6 +270,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getItalicAngle() - Test value retrieved from the POST table in the 
font file.
      */
+    @Test
     public void testGetItalicAngle() {
         assertEquals("0", dejavuTTFFile.getItalicAngle());
         assertEquals("0", droidmonoTTFFile.getItalicAngle());
@@ -262,6 +279,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getKerning() - Test values retrieved from the kern table in the 
font file.
      */
+    @Test
     public void testGetKerning() {
         Map<Integer, Map<Integer, Integer>> kerning = 
dejavuTTFFile.getKerning();
         if (kerning.isEmpty()) {
@@ -282,6 +300,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test lastChar() - TODO: implement a more intelligent test
      */
+    @Test
     public void testLastChar() {
         assertEquals(0xff, dejavuTTFFile.getLastChar());
         assertEquals(0xff, droidmonoTTFFile.getLastChar());
@@ -293,6 +312,7 @@ public class TTFFileTest extends TestCas
      * 2) Fall back to values from the OS/2 table
      * Test values retrieved from the font file.
      */
+    @Test
     public void testGetLowerCaseAscent() {
         assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1556),
                 dejavuTTFFile.getLowerCaseAscent());
@@ -304,6 +324,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getPostScriptName() - Test values retrieved from the post table in 
the font file.
      */
+    @Test
     public void testGetPostScriptName() {
         assertEquals(PostScriptVersion.V2, 
dejavuTTFFile.getPostScriptVersion());
         assertEquals(PostScriptVersion.V2, 
droidmonoTTFFile.getPostScriptVersion());
@@ -312,6 +333,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getStemV() - Undefined.
      */
+    @Test
     public void testGetStemV() {
         // Undefined
         assertEquals("0", dejavuTTFFile.getStemV());
@@ -321,6 +343,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getSubFamilyName() - Test values retrieved from the name table in 
the font file.
      */
+    @Test
     public void testGetSubFamilyName() {
         assertEquals("Book", dejavuTTFFile.getSubFamilyName());
         assertEquals("Regular", droidmonoTTFFile.getSubFamilyName());
@@ -336,6 +359,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getWeightClass() - Test value retrieved from the OS/2 table in the 
font file.
      */
+    @Test
     public void testGetWeightClass() {
         // Retrieved from OS/2 table
         assertEquals(400, dejavuTTFFile.getWeightClass());
@@ -345,6 +369,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test getWidths() - Test values retrieved from the hmtx table in the 
font file.
      */
+    @Test
     public void testGetWidths() {
         int[] widths = dejavuTTFFile.getWidths();
         // using the width of 'A' index = 36
@@ -366,6 +391,7 @@ public class TTFFileTest extends TestCas
      * Fall back:
      * 3) The xheight in the OS/2 table.
      */
+    @Test
     public void testGetXHeight() {
         // Since there's no PCLT table, the height of 'x' is used for both 
DejaVu and DroidSansMono
         assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(1064), 
dejavuTTFFile.getXHeight());
@@ -375,6 +401,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test isCFF() - TODO: add test for a CFF font.
      */
+    @Test
     public void testIsCFF() {
         // Neither DejaVu nor DroidSansMono are a compact format font
         assertEquals(false, dejavuTTFFile.isCFF());
@@ -384,6 +411,7 @@ public class TTFFileTest extends TestCas
     /**
      * Test isEmbeddable() - Test value retrieved from the OS/2 table in the 
font file.
      */
+    @Test
     public void testIsEmbeddable() {
         // Dejavu and DroidSansMono are both embeddable
         assertEquals(true, dejavuTTFFile.isEmbeddable());

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFSubSetFileTestCase.java
 Mon May 28 15:50:35 2012
@@ -24,18 +24,23 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
 /**
  * This class tests TTFSubSetFile
  * TODO: Test with more than just a single font
  */
-public class TTFSubSetFileTest extends TTFFileTest {
+public class TTFSubSetFileTestCase extends TTFFileTestCase {
     private TTFSubSetFile ttfSubset;
     private byte[] subset;
     /**
      * Constructor
      * @throws IOException exception
      */
-    public TTFSubSetFileTest() throws IOException {
+    public TTFSubSetFileTestCase() throws IOException {
         super();
     }
 
@@ -43,6 +48,7 @@ public class TTFSubSetFileTest extends T
      * setUp()
      * @exception IOException file read error
      */
+    @Before
     public void setUp() throws IOException {
         ttfSubset = new TTFSubSetFile();
         Map<Integer, Integer> glyphs = new HashMap<Integer, Integer>();
@@ -58,6 +64,7 @@ public class TTFSubSetFileTest extends T
      * create a cmap table, and so the font doesn't contain ALL of the 
mandatory tables.
      * @throws IOException exception
      */
+    @Test
     public void testReadFont3Args() throws IOException {
 
         ByteArrayInputStream byteArray = new ByteArrayInputStream(subset);

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/fonts/truetype/TTFTableNameTestCase.java
 Mon May 28 15:50:35 2012
@@ -19,18 +19,23 @@
 
 package org.apache.fop.fonts.truetype;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * This class tests the enum org.apache.fop.fonts.truetype.TTFTableName
  *
  */
-public class TTFTableNameTest extends TestCase {
+public class TTFTableNameTestCase {
     /**
      * Test getName() - tests that the getName() method returns the expected 
String as expected in
      * the Directory Table.
      * @exception IllegalAccessException error
      */
+    @Test
     public void testGetName() throws IllegalAccessException {
         assertEquals("dirTable", TTFTableName.DIRECTORY_TABLE.getName());
         assertEquals("EBDT", TTFTableName.EBDT.getName());
@@ -71,6 +76,7 @@ public class TTFTableNameTest extends Te
      * TTFTableNames value when it is given a String (name of a table).
      * @exception IllegalAccessException error
      */
+    @Test
     public void testGetValue() throws IllegalAccessException {
         assertEquals(TTFTableName.EBDT, TTFTableName.getValue("EBDT"));
         assertEquals(TTFTableName.EBLC, TTFTableName.getValue("EBLC"));
@@ -107,6 +113,7 @@ public class TTFTableNameTest extends Te
      * objects and comparing their hash-codes.
      * @exception IllegalAccessException error
      */
+    @Test
     public void testHashCode() throws IllegalAccessException {
         TTFTableName a = TTFTableName.getValue("testObject");
         TTFTableName b = TTFTableName.getValue("testObject");
@@ -124,6 +131,7 @@ public class TTFTableNameTest extends Te
      * 5) check it fails if you put in a null value
      * @throws IllegalAccessException error
      */
+    @Test
     public void testEquals() throws IllegalAccessException {
         // Reflexivity
         TTFTableName a = TTFTableName.getValue("test");

Modified: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java?rev=1343299&r1=1343298&r2=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/RenderPSTestSuite.java
 Mon May 28 15:50:35 2012
@@ -19,37 +19,25 @@
 
 package org.apache.fop.render.ps;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.fop.render.ps.fonts.PSTTFGeneratorTest;
-import org.apache.fop.render.ps.fonts.PSTTFGlyphOutputStreamTest;
-import org.apache.fop.render.ps.fonts.PSTTFOutputStreamTest;
-import org.apache.fop.render.ps.fonts.PSTTFTableOutputStreamTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import org.apache.fop.render.ps.fonts.PSTTFGeneratorTestCase;
+import org.apache.fop.render.ps.fonts.PSTTFGlyphOutputStreamTestCase;
+import org.apache.fop.render.ps.fonts.PSTTFOutputStreamTestCase;
+import org.apache.fop.render.ps.fonts.PSTTFTableOutputStreamTestCase;
 
 
 /**
  * A test Suite for org.apache.fop.render.ps.*
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+        PSTTFGeneratorTestCase.class,
+        PSTTFOutputStreamTestCase.class,
+        PSTTFGlyphOutputStreamTestCase.class,
+        PSTTFTableOutputStreamTestCase.class
+})
 public final class RenderPSTestSuite {
-    /**
-     * Constructor.
-     */
-    private RenderPSTestSuite() {
-    }
-
-    /**
-     * Testing org.apache.fop.render.ps.*
-     * @return test
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite();
-        //$JUnit-BEGIN$
-        suite.addTest(new TestSuite(PSTTFGeneratorTest.class));
-        suite.addTest(new TestSuite(PSTTFOutputStreamTest.class));
-        suite.addTest(new TestSuite(PSTTFGlyphOutputStreamTest.class));
-        suite.addTest(new TestSuite(PSTTFTableOutputStreamTest.class));
-        //$JUnit-END$
-        return suite;
-    }
 }

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGeneratorTestCase.java
 Mon May 28 15:50:35 2012
@@ -22,14 +22,19 @@ package org.apache.fop.render.ps.fonts;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+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.xmlgraphics.ps.PSGenerator;
 
 /**
  * The test class for org.apache.fop.render.ps.fonts.PSGenerator
  */
-public class PSTTFGeneratorTest extends TestCase {
+public class PSTTFGeneratorTestCase {
     private PSTTFGenerator ttfGen;
     private ByteArrayOutputStream out = new ByteArrayOutputStream();
     private PSGenerator gen = new PSGenerator(out);
@@ -38,14 +43,14 @@ public class PSTTFGeneratorTest extends 
     /**
      * Constructor
      */
-    public PSTTFGeneratorTest() {
+    public PSTTFGeneratorTestCase() {
         byteArray = new byte[65536];
         for (int i = 0; i < 65536; i++) {
             byteArray[i] = (byte) i;
         }
     }
 
-    @Override
+    @Before
     public void setUp() {
         ttfGen = new PSTTFGenerator(gen);
     }
@@ -54,6 +59,7 @@ public class PSTTFGeneratorTest extends 
      * Tests startString() - starts the string in an appropriate way for a 
PostScript file.
      * @exception IOException write error
      */
+    @Test
     public void testStartString() throws IOException {
         ttfGen.startString();
         assertEquals("<\n", out.toString());
@@ -63,6 +69,7 @@ public class PSTTFGeneratorTest extends 
      * Test streamBytes() - tests that strings are written to file in the 
proper format.
      * @throws IOException write error.
      */
+    @Test
     public void testStreamBytes() throws IOException {
         ttfGen.streamBytes(byteArray, 0, 16);
         assertEquals("000102030405060708090A0B0C0D0E0F", out.toString());
@@ -86,6 +93,7 @@ public class PSTTFGeneratorTest extends 
      * following string streamed to the PS document should be 80 chars long.
      * @throws IOException file write error.
      */
+    @Test
     public void testReset() throws IOException {
         ttfGen.streamBytes(byteArray, 0, 40);
         assertTrue(out.toString().matches("([0-9A-F]{80}\n)"));
@@ -99,6 +107,7 @@ public class PSTTFGeneratorTest extends 
      * format, a "00" needs to be appended to the end of a string.
      * @throws IOException file write error
      */
+    @Test
     public void testEndString() throws IOException {
         ttfGen.endString();
         assertEquals("00\n> ", out.toString());

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStreamTestCase.java
 Mon May 28 15:50:35 2012
@@ -19,25 +19,26 @@
 
 package org.apache.fop.render.ps.fonts;
 
+import java.io.IOException;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InOrder;
+
+import static org.junit.Assert.fail;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.mockito.InOrder;
-
 /**
  * Test class for PSTTFGlyphOutputStream
  */
-public class PSTTFGlyphOutputStreamTest extends TestCase {
+public class PSTTFGlyphOutputStreamTestCase {
     private PSTTFGenerator mockGen;
     private PSTTFGlyphOutputStream glyphOut;
 
-    @Override
+    @Before
     public void setUp() {
         mockGen = mock(PSTTFGenerator.class);
         glyphOut = new PSTTFGlyphOutputStream(mockGen);
@@ -48,6 +49,7 @@ public class PSTTFGlyphOutputStreamTest 
      * PSTTFGenerator.
      * @exception IOException file write error
      */
+    @Test
     public void testStartGlyphStream() throws IOException {
         glyphOut.startGlyphStream();
         verify(mockGen).startString();
@@ -61,6 +63,7 @@ public class PSTTFGlyphOutputStreamTest 
      * 3) if a glyph of size > PSTTFGenerator.MAX_BUFFER_SIZE is attempted, an 
exception is thrown.
      * @throws IOException file write error.
      */
+    @Test
     public void testStreamGlyph() throws IOException {
         int byteArraySize = 10;
         byte[] byteArray = new byte[byteArraySize];
@@ -98,6 +101,7 @@ public class PSTTFGlyphOutputStreamTest 
      * is called.
      * @throws IOException file write exception
      */
+    @Test
     public void testEndGlyphStream() throws IOException {
         glyphOut.endGlyphStream();
         verify(mockGen).endString();

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFOutputStreamTestCase.java
 Mon May 28 15:50:35 2012
@@ -19,27 +19,31 @@
 
 package org.apache.fop.render.ps.fonts;
 
+import java.io.IOException;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-import java.io.IOException;
-
-import junit.framework.TestCase;
+import org.apache.xmlgraphics.ps.PSGenerator;
 
 import org.apache.fop.fonts.truetype.TTFGlyphOutputStream;
 import org.apache.fop.fonts.truetype.TTFTableOutputStream;
-import org.apache.xmlgraphics.ps.PSGenerator;
 
 /**
  * Tests PSTTFOuputStream
  */
-public class PSTTFOutputStreamTest extends TestCase {
+public class PSTTFOutputStreamTestCase {
     private PSGenerator gen;
     private PSTTFOutputStream out;
 
     /**
      * Assigns an OutputStream to the PSGenerator.
      */
+    @Before
     public void setUp() {
         gen = mock(PSGenerator.class);
         out = new PSTTFOutputStream(gen);
@@ -50,6 +54,7 @@ public class PSTTFOutputStreamTest exten
      * document (in this case with "/sfnts[")
      * @throws IOException write exception.
      */
+    @Test
     public void testStartFontStream() throws IOException {
         out.startFontStream();
         verify(gen).write("/sfnts[");
@@ -58,6 +63,7 @@ public class PSTTFOutputStreamTest exten
     /**
      * Test getTableOutputStream() - we need to test that the inheritance 
model is properly obeyed.
      */
+    @Test
     public void testGetTableOutputStream() {
         TTFTableOutputStream tableOut = out.getTableOutputStream();
         assertTrue(tableOut instanceof PSTTFTableOutputStream);
@@ -66,6 +72,7 @@ public class PSTTFOutputStreamTest exten
     /**
      * Test getGlyphOutputStream() - we need to test that the inheritance 
model is properly obeyed.
      */
+    @Test
     public void testGetGlyphOutputStream() {
         TTFGlyphOutputStream glyphOut = out.getGlyphOutputStream();
         assertTrue(glyphOut instanceof PSTTFGlyphOutputStream);
@@ -75,6 +82,7 @@ public class PSTTFOutputStreamTest exten
      * Test endFontStream()
      * @exception IOException write error.
      */
+    @Test
     public void testEndFontStream() throws IOException {
         out.endFontStream();
         verify(gen).writeln("] def");

Copied: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java
 (from r1341381, 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTest.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java?p2=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java&p1=xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTest.java&r1=1341381&r2=1343299&rev=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStreamTestCase.java
 Mon May 28 15:50:35 2012
@@ -19,23 +19,23 @@
 
 package org.apache.fop.render.ps.fonts;
 
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-
 import java.io.IOException;
 
-import junit.framework.TestCase;
-
+import org.junit.Before;
+import org.junit.Test;
 import org.mockito.InOrder;
 
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+
 /**
  * Test class for unit testing PSTTFTableOutputStream
  */
-public class PSTTFTableOutputStreamTest extends TestCase {
+public class PSTTFTableOutputStreamTestCase {
     private PSTTFGenerator mockGen;
     private PSTTFTableOutputStream tableOut;
 
-    @Override
+    @Before
     public void setUp() {
         mockGen = mock(PSTTFGenerator.class);
         tableOut = new PSTTFTableOutputStream(mockGen);
@@ -53,6 +53,7 @@ public class PSTTFTableOutputStreamTest 
      * are invoked.
      * @throws IOException file write error.
      */
+    @Test
     public void testStreamTable() throws IOException {
         byte[] byteArray = new byte[PSTTFGenerator.MAX_BUFFER_SIZE * 3];
         tableOut.streamTable(byteArray, 0, 10);

Modified: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/util/HexEncoderTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/util/HexEncoderTestCase.java?rev=1343299&r1=1343298&r2=1343299&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/util/HexEncoderTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/util/HexEncoderTestCase.java
 Mon May 28 15:50:35 2012
@@ -19,20 +19,24 @@
 
 package org.apache.fop.util;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * Test case for the conversion of characters into hex-encoded strings.
  */
-public class HexEncoderTestCase extends TestCase {
+public class HexEncoderTestCase {
 
-    private static char successor(char d) {
-        if (d == '9') {
-            return 'A';
-        } else if (d == 'F') {
-            return '0';
-        } else {
-            return (char) (d + 1);
+    /**
+     * Tests that characters are properly encoded into hex strings.
+     */
+    @Test
+    public void testEncodeChar() {
+        char[] digits = new char[] {'0', '0', '0', '0'};
+        for (int c = 0; c <= 0xFFFF; c++) {
+            assertEquals(new String(digits), HexEncoder.encode((char) c));
+            increment(digits);
         }
     }
 
@@ -44,14 +48,13 @@ public class HexEncoderTestCase extends 
         } while (digits[d] == '0' && d > 0);
     }
 
-    /**
-     * Tests that characters are properly encoded into hex strings.
-     */
-    public void testEncodeChar() {
-        char[] digits = new char[] {'0', '0', '0', '0'};
-        for (int c = 0; c <= 0xFFFF; c++) {
-            assertEquals(new String(digits), HexEncoder.encode((char) c));
-            increment(digits);
+    private static char successor(char d) {
+        if (d == '9') {
+            return 'A';
+        } else if (d == 'F') {
+            return '0';
+        } else {
+            return (char) (d + 1);
         }
     }
 

Added: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/ttf/DroidSansMono.ttf
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/ttf/DroidSansMono.ttf?rev=1343299&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/resources/fonts/ttf/DroidSansMono.ttf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to