Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/URIResolutionTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/URIResolutionTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/URIResolutionTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/URIResolutionTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,6 +19,9 @@
 
 package org.apache.fop;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.OutputStream;
@@ -36,19 +39,19 @@ import javax.xml.transform.sax.Transform
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
-import org.w3c.dom.Document;
-
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.output.ByteArrayOutputStream;
-import org.apache.xpath.XPathAPI;
-import org.apache.xpath.objects.XObject;
-
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.Fop;
 import org.apache.fop.apps.FopFactory;
 import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.render.xml.XMLRenderer;
+import org.apache.xpath.XPathAPI;
+import org.apache.xpath.objects.XObject;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.w3c.dom.Document;
 
 /**
  * Tests URI resolution facilities.
@@ -61,11 +64,10 @@ public class URIResolutionTestCase exten
     private SAXTransformerFactory tfactory
             = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
 
-    private File backupDir = new File(getBaseDir(), "build/test-results");
+    private final static File backupDir = new File(getBaseDir(), 
"build/test-results");
 
-    /** @see junit.framework.TestCase#TestCase(String) */
-    public URIResolutionTestCase(String name) {
-        super(name);
+    @BeforeClass
+    public static void makeDirs() {
         backupDir.mkdirs();
     }
 
@@ -73,6 +75,7 @@ public class URIResolutionTestCase exten
      * Test custom URI resolution with a hand-written URIResolver.
      * @throws Exception if anything fails
      */
+    @Test
     public void testFO1a() throws Exception {
         innerTestFO1(false);
     }
@@ -81,6 +84,7 @@ public class URIResolutionTestCase exten
      * Test custom URI resolution with a hand-written URIResolver.
      * @throws Exception if anything fails
      */
+    @Test
     public void testFO1b() throws Exception {
         innerTestFO1(true);
     }
@@ -112,7 +116,8 @@ public class URIResolutionTestCase exten
      * Test custom URI resolution with a hand-written URIResolver.
      * @throws Exception if anything fails
      */
-    public void DISABLEDtestFO2() throws Exception {
+    @Test
+    public void testFO2() throws Exception {
         //TODO This will only work when we can do URI resolution inside Batik!
         File foFile = new File(getBaseDir(), "test/xml/uri-resolution2.fo");
 

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/UtilityCodeTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/UtilityCodeTestSuite.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/UtilityCodeTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/UtilityCodeTestSuite.java
 Tue Oct 18 08:33:32 2011
@@ -19,8 +19,9 @@
 
 package org.apache.fop;
 
-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.events.BasicEventTestCase;
 import org.apache.fop.pdf.FileIDGeneratorTestCase;
@@ -31,35 +32,28 @@ import org.apache.fop.traits.BorderProps
 import org.apache.fop.util.BitmapImageUtilTestCase;
 import org.apache.fop.util.ColorUtilTestCase;
 import org.apache.fop.util.ElementListUtilsTestCase;
+import org.apache.fop.util.NumberConverterTestCase;
 import org.apache.fop.util.PDFNumberTestCase;
 import org.apache.fop.util.XMLResourceBundleTestCase;
 
 /**
  * Test suite for FOP's utility classes.
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+    PDFNumberTestCase.class,
+    PDFObjectTestCase.class,
+    ColorUtilTestCase.class,
+    BorderPropsTestCase.class,
+    ElementListUtilsTestCase.class,
+    BasicEventTestCase.class,
+    XMLResourceBundleTestCase.class,
+    URIResolutionTestCase.class,
+    FileIDGeneratorTestCase.class,
+    PDFFactoryTestCase.class,
+    PDFEncryptionJCETestCase.class,
+    BitmapImageUtilTestCase.class,
+    NumberConverterTestCase.class
+})
 public class UtilityCodeTestSuite {
-
-    /**
-     * Builds the test suite
-     * @return the test suite
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite(
-            "Test suite for FOP's utility classes");
-        //$JUnit-BEGIN$
-        suite.addTest(new TestSuite(PDFNumberTestCase.class));
-        suite.addTest(new TestSuite(PDFObjectTestCase.class));
-        suite.addTest(FileIDGeneratorTestCase.suite());
-        suite.addTest(new TestSuite(PDFFactoryTestCase.class));
-        suite.addTest(new TestSuite(ColorUtilTestCase.class));
-        suite.addTest(new TestSuite(BorderPropsTestCase.class));
-        suite.addTest(new TestSuite(ElementListUtilsTestCase.class));
-        suite.addTest(new TestSuite(BasicEventTestCase.class));
-        suite.addTest(new TestSuite(XMLResourceBundleTestCase.class));
-        suite.addTest(new TestSuite(URIResolutionTestCase.class));
-        suite.addTest(new TestSuite(BitmapImageUtilTestCase.class));
-        suite.addTest(new TestSuite(PDFEncryptionJCETestCase.class));
-        //$JUnit-END$
-        return suite;
-    }
 }

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,20 +19,20 @@
 
 package org.apache.fop.afp;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.util.Arrays;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.io.IOUtils;
-
 import org.apache.fop.afp.util.AFPResourceUtil;
+import org.junit.Test;
 
 /**
  * Tests the {@link AFPResourceUtil} class.
  */
-public class  AFPResourceUtilTestCase extends TestCase {
+public class AFPResourceUtilTestCase {
 
     private static final String RESOURCE_FILENAME = "expected_resource.afp";
 
@@ -44,6 +44,7 @@ public class  AFPResourceUtilTestCase ex
      * Tests copyResourceFile()
      * @throws Exception -
      */
+    @Test
     public void testCopyResourceFile() throws Exception {
 
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -74,6 +75,7 @@ public class  AFPResourceUtilTestCase ex
      * Tests copyNamedResource()
      * @throws Exception -
      */
+    @Test
     public void testCopyNamedResource() throws Exception {
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPTestSuite.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPTestSuite.java
 Tue Oct 18 08:33:32 2011
@@ -19,27 +19,18 @@
 
 package org.apache.fop.afp;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.fop.afp.modca.AbstractStructuredObjectTestCase;
-import org.apache.fop.afp.modca.AbstractTripletStructuredObjectTestCase;
 import org.apache.fop.afp.modca.IncludeObjectTestCase;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /**
  * Test suite for FOP's AFP classes.
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+    IncludeObjectTestCase.class,
+    AFPResourceUtilTestCase.class
+})
 public class AFPTestSuite {
-    /**
-     * Builds the test suite
-     * @return the test suite
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test suite for FOP's AFP classes");
-        //$JUnit-BEGIN$
-        suite.addTest(new TestSuite(IncludeObjectTestCase.class));
-        suite.addTest(new TestSuite(AFPResourceUtilTestCase.class));
-        //$JUnit-END$
-        return suite;
-    }
 }

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTest.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTest.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTest.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTest.java
 Tue Oct 18 08:33:32 2011
@@ -19,19 +19,25 @@
 
 package org.apache.fop.afp.fonts;
 
+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.nio.charset.CharacterCodingException;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test {@link CharactersetEncoder}
  */
-public class CharactersetEncoderTest extends TestCase {
+public class CharactersetEncoderTest {
     private CharactersetEncoder singlebyteEncoder;
     private CharactersetEncoder doublebyteEncoder;
 
+    @Before
     public void setUp() {
         singlebyteEncoder = CharactersetEncoder.newInstance("cp500", false);
         doublebyteEncoder = CharactersetEncoder.newInstance("cp937", true);
@@ -71,6 +77,7 @@ public class CharactersetEncoderTest ext
     /**
      * Tests canEncode() - tests that canEncode() responds properly to various 
input characters.
      */
+    @Test
     public void testCanEncode() {
         // Both SBCS and DBCS should support Latin characters
         for (char c = '!'; c < '~'; c++) {
@@ -86,6 +93,7 @@ public class CharactersetEncoderTest ext
         assertFalse(doublebyteEncoder.canEncode('\u00BB'));
     }
 
+    @Test
     public void testEncode() throws CharacterCodingException, IOException {
         CharactersetEncoder.EncodedChars encChars;// = 
doublebyteEncoder.encode(testCJKText);
         ByteArrayOutputStream bOut = new ByteArrayOutputStream();

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,6 +19,10 @@
 
 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;
@@ -26,15 +30,13 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.TestCase;
-
 import org.apache.fop.afp.Streamable;
+import org.junit.Test;
 
 /**
  * Tests the {@link AbstractAFPObject} class.
  */
-public abstract class  AbstractAFPObjectTestCase<S extends  AbstractAFPObject>
-        extends TestCase {
+public abstract class AbstractAFPObjectTestCase<S extends AbstractAFPObject> {
 
     private S sut;
 
@@ -61,7 +63,7 @@ public abstract class  AbstractAFPObject
             0x00 // Reserved
     };
 
-
+    @Test
     public void testCopySFStatic() {
         byte[] actual = new byte[9];
         Arrays.fill(actual, (byte)-1);
@@ -85,6 +87,7 @@ public abstract class  AbstractAFPObject
         assertTrue(Arrays.equals(actual, expected2));
     }
 
+    @Test
     public void testCopySF() {
         byte[] expected = new byte[9];
         S.copySF(expected, (byte) 0xD3, (byte)0, (byte)0);
@@ -112,6 +115,7 @@ public abstract class  AbstractAFPObject
     /**
      *
      */
+    @Test
     public void testwriteObjects() {
        final byte[][] expected = {{(byte)0, (byte)1}, {(byte)2, (byte)3}, 
{(byte)4, (byte)5}};
 
@@ -144,6 +148,7 @@ public abstract class  AbstractAFPObject
     /**
      *
      */
+    @Test
     public void testTruncate() {
         String expected = "abc";
         assertTrue(AbstractAFPObject.truncate(expected, 4)  == expected);
@@ -161,6 +166,7 @@ public abstract class  AbstractAFPObject
     /**
      *
      */
+    @Test
     public void testWriteChunksToStream() throws IOException {
         final byte[] data = new byte[256];
         int counter = 0;

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,14 +19,18 @@
 
 package org.apache.fop.afp.modca;
 
+import static org.junit.Assert.assertTrue;
+
 import java.util.Arrays;
 
+import org.junit.Test;
+
 /**
  * Tests the {@linkplain AbstractAFPObject} class.
  */
 public abstract class AbstractNamedAFPObjectTestCase<S extends  
AbstractNamedAFPObject>
         extends AbstractAFPObjectTestCase<S> {
-
+    @Test
     public void testCopySF() {
 
         final S sut = getSut();

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,6 +19,10 @@
 
 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;
@@ -31,6 +35,7 @@ import org.apache.fop.afp.modca.triplets
 import org.apache.fop.afp.modca.triplets.CommentTriplet;
 import org.apache.fop.afp.modca.triplets.ObjectAreaSizeTriplet;
 import org.apache.fop.afp.modca.triplets.Triplet;
+import org.junit.Before;
 
 /**
  * Test {@link AbstractTripletStructuredObject}
@@ -55,10 +60,8 @@ public abstract class AbstractTripletStr
     private AbstractTripletStructuredObject emptyStructuredObject
             = new AbstractTripletStructuredObject() { };
 
-    @Override
+    @Before
     public void setUp() throws Exception {
-        super.setUp();
-
         AbstractTripletStructuredObject sut = getSut();
 
         for (AbstractTriplet triplet : TRIPLETS) {

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,27 +19,31 @@
 
 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;
 
 /**
  * Test {@link IncludeObject}
  */
 public class IncludeObjectTestCase extends 
AbstractNamedAFPObjectTestCase<IncludeObject> {
 
-    @Override
+    @Before
     public void setUp() throws Exception {
         setSut(new IncludeObject("8__chars"));
-        super.setUp();
     }
 
     /**
      * Test writeToStream()
      * @throws IOException -
      */
+    @Test
     public void testWriteToStream() throws IOException {
         final IncludeObject sut = getSut();
 
@@ -53,6 +57,7 @@ public class IncludeObjectTestCase exten
      * handed with a 180 x-axis
      * @throws IOException -
      */
+    @Test
     public void testWriteToStreamForOrientation() throws IOException {
         final IncludeObject sut = getSut();
 

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/parser/MODCAParserTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/parser/MODCAParserTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/parser/MODCAParserTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/parser/MODCAParserTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,18 +19,23 @@
 
 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;
 import java.io.InputStream;
 import java.util.Arrays;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 /**
  * MODCAParser and MODCAParser.UnparsedStructuredField Unit tests
  */
-public class MODCAParserTestCase extends TestCase {
+public class MODCAParserTestCase {
 
     /** The carriage control character (0x5A) used to indicate the start of a 
structured field. */
     public static final byte CARRIAGE_CONTROL_CHAR = (byte)0x5A;
@@ -47,6 +52,7 @@ public class MODCAParserTestCase extends
      *
      * @throws Exception *
      */
+    @Test
     public void testReadNextStructuredField1() throws Exception {
 
         // carriage control (0x5A) delimits structured fields,
@@ -87,6 +93,7 @@ public class MODCAParserTestCase extends
      *
      * @throws Exception *
      */
+    @Test
     public void testReadNextStructuredField2() throws Exception {
 
         // no extension data

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/BlockViewportTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/BlockViewportTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/BlockViewportTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/BlockViewportTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,12 +19,14 @@
 
 package org.apache.fop.area;
 
+import org.junit.Test;
 
 /**
  * Tests the {@linkplain BlockViewport} class.
  */
 public class BlockViewportTestCase extends ViewportTestCase {
 
+    @Test
     public void testNonClip() throws Exception {
         BlockViewport bv = new BlockViewport();
         bv.setIPD(100);
@@ -32,6 +34,7 @@ public class BlockViewportTestCase exten
         checkNonClip(bv);
     }
 
+    @Test
     public void testClip() throws Exception {
         BlockViewport bv = new BlockViewport();
         int ipd = 100;

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/RegionViewportTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/RegionViewportTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/RegionViewportTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/RegionViewportTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -22,6 +22,8 @@ package org.apache.fop.area;
 import java.awt.Rectangle;
 import java.awt.geom.Rectangle2D;
 
+import org.junit.Test;
+
 /**
  * Tests the {@linkplain RegionViewport} class.
  */
@@ -35,11 +37,13 @@ public class RegionViewportTestCase exte
         return viewport;
     }
 
+    @Test
     public void testNonClip() throws Exception {
         RegionViewport viewport = createRegionViewport(10, 10, 100, 20);
         checkNonClip(viewport);
     }
 
+    @Test
     public void testClip() throws Exception {
         int ipd = 150;
         int bpd = 20;

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,14 +19,17 @@
 
 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 junit.framework.TestCase;
+import java.awt.Rectangle;
 
 /**
  * Tests implementations of the {@linkplain Viewport} interface.
  */
-public abstract class ViewportTestCase extends TestCase {
+public abstract class ViewportTestCase {
 
     protected void checkNonClip(Viewport v) throws Exception {
         assertFalse(v.hasClip());

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestSuite.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/ViewportTestSuite.java
 Tue Oct 18 08:33:32 2011
@@ -19,29 +19,19 @@
 
 package org.apache.fop.area;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.apache.fop.area.inline.InlineViewportTestCase;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /**
  * A suite of all the tests relating to the {@linkplain Viewport} interface.
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+    RegionViewportTestCase.class,
+    BlockViewportTestCase.class,
+    InlineViewportTestCase.class
+})
 public final class ViewportTestSuite {
-
-    private ViewportTestSuite() { }
-
-    /**
-     * Returns the suite of {@linkplain Viewport} implementation tests.
-     *
-     * @return the tests
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for viewport-areas");
-        suite.addTestSuite(RegionViewportTestCase.class);
-        suite.addTestSuite(BlockViewportTestCase.class);
-        suite.addTestSuite(InlineViewportTestCase.class);
-        return suite;
-    }
-
 }

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/inline/InlineViewportTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/inline/InlineViewportTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/inline/InlineViewportTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/area/inline/InlineViewportTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -20,12 +20,14 @@
 package org.apache.fop.area.inline;
 
 import org.apache.fop.area.ViewportTestCase;
+import org.junit.Test;
 
 /**
  * Tests the {@linkplain InlineViewport} class.
  */
 public class InlineViewportTestCase extends ViewportTestCase {
 
+    @Test
     public void testNonClip() throws Exception {
         InlineViewport v = new InlineViewport(null);
         v.setIPD(50);
@@ -33,6 +35,7 @@ public class InlineViewportTestCase exte
         checkNonClip(v);
     }
 
+    @Test
     public void testClip() throws Exception {
         InlineViewport v = new InlineViewport(null);
         int ipd = 50;

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/ComplexScriptsTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/ComplexScriptsTestSuite.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/ComplexScriptsTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/ComplexScriptsTestSuite.java
 Tue Oct 18 08:33:32 2011
@@ -19,31 +19,22 @@
 
 package org.apache.fop.complexscripts;
 
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
 import org.apache.fop.complexscripts.bidi.BidiTestSuite;
 import org.apache.fop.complexscripts.fonts.FontsTestSuite;
 import org.apache.fop.complexscripts.scripts.ScriptsTestSuite;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 /**
  * Test suite for complex scripts functionality.
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+    BidiTestSuite.class,
+    FontsTestSuite.class,
+    ScriptsTestSuite.class
+})
 public class ComplexScriptsTestSuite {
-
-    /**
-     * Builds the test suite
-     * @return the test suite
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite(
-            "Test suite for complex scripts functionality");
-        //$JUnit-BEGIN$
-        suite.addTest(BidiTestSuite.suite());
-        suite.addTest(FontsTestSuite.suite());
-        suite.addTest(ScriptsTestSuite.suite());
-        //$JUnit-END$
-        return suite;
-    }
-
 }

Added: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestCase.java?rev=1185530&view=auto
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestCase.java
 (added)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.complexscripts.arabic;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FilenameFilter;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+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.util.TTXFile;
+import org.apache.fop.fonts.GlyphPositioningTable;
+import org.apache.fop.fonts.GlyphSequence;
+import org.apache.fop.fonts.GlyphSubstitutionTable;
+
+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;
+
+/**
+ * Tests for functionality related to the arabic script.
+ */
+public class ArabicTestCase implements ArabicTestConstants {
+
+    @Test
+    public void testArabicWordForms() {
+        for ( String sfn : srcFiles ) {
+            try {
+                processWordForms ( new File ( datFilesDir ) );
+            } catch ( Exception e ) {
+                fail ( e.getMessage() );
+            }
+        }
+    }
+
+    private void processWordForms ( File dfd ) {
+        String[] files = listWordFormFiles ( dfd );
+        for ( String fn : files ) {
+            File dff = new File ( dfd, fn );
+            processWordForms ( dff.getAbsolutePath() );
+        }
+    }
+
+    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 );
+                }
+                private boolean hasPrefixFrom ( String name, String[] prefixes 
) {
+                    for ( String p : prefixes ) {
+                        if ( name.startsWith ( p ) ) {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+                private boolean hasExtension ( String name, String extension ) 
{
+                    return name.endsWith ( "." + extension );
+                }
+            } );
+    }
+
+    private void processWordForms ( String dpn ) {
+        FileInputStream fis = null;
+        try {
+            fis = new FileInputStream ( dpn );
+            if ( fis != null ) {
+                ObjectInputStream ois = new ObjectInputStream ( fis );
+                List<Object[]> data = (List<Object[]>) ois.readObject();
+                if ( data != null ) {
+                    processWordForms ( data );
+                }
+                ois.close();
+            }
+        } catch ( FileNotFoundException e ) {
+            throw new RuntimeException ( e.getMessage(), e );
+        } catch ( IOException e ) {
+            throw new RuntimeException ( e.getMessage(), e );
+        } catch ( Exception e ) {
+            throw new RuntimeException ( e.getMessage(), e );
+        } finally {
+            if ( fis != null ) {
+                try { fis.close(); } catch ( Exception e ) {}
+            }
+        }
+    }
+
+    private void processWordForms ( List<Object[]> data ) {
+        assert data != null;
+        assert data.size() > 0;
+        String script = null;
+        String language = null;
+        String tfn = null;
+        TTXFile tf = null;
+        GlyphSubstitutionTable gsub = null;
+        GlyphPositioningTable gpos = null;
+        int[] widths = null;
+        for ( Object[] d : data ) {
+            if ( script == null ) {
+                assert d.length >= 4;
+                script = (String) d[0];
+                language = (String) d[1];
+                tfn = (String) d[3];
+                tf = TTXFile.getFromCache ( ttxFontsDir + File.separator + tfn 
);
+                assertTrue ( tf != null );
+                gsub = tf.getGSUB();
+                assertTrue ( gsub != null );
+                gpos = tf.getGPOS();
+                assertTrue ( gpos != null );
+                widths = tf.getWidths();
+                assertTrue ( widths != null );
+            } else {
+                assert tf != null;
+                assert gsub != null;
+                assert gpos != null;
+                assert tfn != null;
+                assert d.length >= 4;
+                String wf = (String) d[0];
+                int[] iga = (int[]) d[1];
+                int[] oga = (int[]) d[2];
+                int[][] paa = (int[][]) d[3];
+                GlyphSequence tigs = tf.mapCharsToGlyphs ( wf );
+                assertSameGlyphs ( iga, getGlyphs ( tigs ), "input glyphs", 
wf, tfn );
+                GlyphSequence togs = gsub.substitute ( tigs, script, language 
);
+                assertSameGlyphs ( oga, getGlyphs ( togs ), "output glyphs", 
wf, tfn );
+                int[][] tpaa = new int [ togs.getGlyphCount() ] [ 4 ];
+                if ( gpos.position ( togs, script, language, 1000, widths, 
tpaa ) ) {
+                    assertSameAdjustments ( paa, tpaa, wf, tfn );
+                } else if ( paa != null ) {
+                    assertEquals ( "unequal adjustment count, word form(" + wf 
+ "), font (" + tfn + ")", paa.length, 0 );
+                }
+            }
+        }
+    }
+
+    private void assertSameGlyphs ( int[] expected, int[] actual, String 
label, String wf, String tfn ) {
+        assertEquals ( label + ": unequal glyph count, word form(" + wf + "), 
font (" + tfn + ")", expected.length, actual.length );
+        for ( int i = 0, n = expected.length; i < n; i++ ) {
+            int e = expected[i];
+            int a = actual[i];
+            assertEquals ( label + ": unequal glyphs[" + i + "], word form(" + 
wf + "), font (" + tfn + ")", e, a );
+        }
+    }
+
+    private void assertSameAdjustments ( int[][] expected, int[][] actual, 
String wf, String tfn  ) {
+        assertEquals ( "unequal adjustment count, word form(" + wf + "), font 
(" + tfn + ")", expected.length, actual.length );
+        for ( int i = 0, n = expected.length; i < n; i++ ) {
+            int[] ea = expected[i];
+            int[] aa = actual[i];
+            assertEquals ( "bad adjustments length, word form(" + wf + "), 
font (" + tfn + ")", ea.length, aa.length );
+            for ( int k = 0; k < 4; k++ ) {
+                int e = ea[k];
+                int a = aa[k];
+                assertEquals ( "unequal adjustment[" + i + "][" + k + "], word 
form(" + wf + "), font (" + tfn + ")", e, a );
+            }
+        }
+    }
+
+    private static int[] getGlyphs ( GlyphSequence gs ) {
+        IntBuffer gb = gs.getGlyphs();
+        int[] ga = new int [ gb.limit() ];
+        gb.rewind();
+        gb.get ( ga );
+        return ga;
+    }
+
+}

Propchange: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestConstants.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestConstants.java?rev=1185530&view=auto
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestConstants.java
 (added)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestConstants.java
 Tue Oct 18 08:33:32 2011
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.complexscripts.arabic;
+
+/**
+ * Constants for test functionality related to the arabic script.
+ */
+public interface ArabicTestConstants {
+
+    final String WF_FILE_SCRIPT = "arab";
+    final String WF_FILE_LANGUAGE = "dflt";
+
+    String srcFilesDir = "test/resources/complexscripts/arab/data";
+    String datFilesDir = "test/resources/complexscripts/arab/data";
+
+    String[] srcFiles = {
+        "arab-001",     // unpointed word forms
+    };
+
+    final String WF_FILE_SRC_EXT = "txt";
+    final String WF_FILE_DAT_EXT = "ser";
+
+    String ttxFontsDir = "test/resources/complexscripts/arab/ttx";
+
+    String[] ttxFonts = {
+        "arab-001.ttx", // simplified arabic
+        "arab-002.ttx", // traditional arabic
+        "arab-003.ttx", // lateef
+        "arab-004.ttx", // scheherazade
+    };
+
+}

Propchange: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/ArabicTestConstants.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/GenerateArabicTestData.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/GenerateArabicTestData.java?rev=1185530&view=auto
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/GenerateArabicTestData.java
 (added)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/GenerateArabicTestData.java
 Tue Oct 18 08:33:32 2011
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.complexscripts.arabic;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.ObjectOutputStream;
+import java.nio.IntBuffer;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.fop.complexscripts.util.TTXFile;
+import org.apache.fop.fonts.GlyphPositioningTable;
+import org.apache.fop.fonts.GlyphSequence;
+import org.apache.fop.fonts.GlyphSubstitutionTable;
+
+/**
+ * Tests for functionality related to the arabic script.
+ */
+public class GenerateArabicTestData implements ArabicTestConstants {
+
+    public static void main ( String[] args ) {
+        boolean compile = false;
+        boolean help = false;
+        for ( String a : args ) {
+            if ( a.equals("-c") ) {
+                compile = true;
+            }
+            if ( a.equals("-?") ) {
+                help = true;
+            }
+        }
+        if ( help ) {
+            help();
+        } else if ( compile ) {
+            compile();
+        }
+    }
+
+    private static void help() {
+        StringBuffer sb = new StringBuffer();
+        sb.append ( "org.apache.fop.complexscripts.arabic.ArabicTestCase" );
+        sb.append ( " [-compile]" );
+        sb.append ( " [-?]" );
+        System.out.println ( sb.toString() );
+    }
+
+    private static void compile() {
+        for ( String sfn : srcFiles ) {
+            try {
+                String spn = srcFilesDir + File.separator + sfn + "." + 
WF_FILE_SRC_EXT;
+                compile ( WF_FILE_SCRIPT, WF_FILE_LANGUAGE, spn );
+            } catch ( Exception e ) {
+                System.err.println ( e.getMessage() );
+            }
+        }
+    }
+
+    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 );
+            assert tf != null;
+            List data = compile ( script, language, spn, tfn, tf );
+            output ( makeDataPathName ( spn, fno++ ), data );
+        }
+    }
+
+    private static List compile ( String script, String language, String spn, 
String tfn, TTXFile tf ) {
+        List<Object[]> data = new ArrayList<Object[]>();
+        data.add ( new Object[] { script, language, spn, tfn } );
+        GlyphSubstitutionTable gsub = tf.getGSUB();
+        GlyphPositioningTable gpos = tf.getGPOS();
+        int[] widths = tf.getWidths();
+        if ( ( gsub != null ) && ( gpos != null ) ) {
+            FileInputStream fis = null;
+            try {
+                fis = new FileInputStream ( spn );
+                if ( fis != null ) {
+                    LineNumberReader lr = new LineNumberReader ( new 
InputStreamReader ( fis, Charset.forName ( "UTF-8" ) ) );
+                    String wf;
+                    while ( ( wf = lr.readLine() ) != null ) {
+                        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 ) ) {
+                            paa = null;
+                        }
+                        data.add ( new Object[] { wf, getGlyphs ( igs ), 
getGlyphs ( ogs ), paa } );
+                    }
+                    lr.close();
+                }
+            } catch ( FileNotFoundException e ) {
+                throw new RuntimeException ( e.getMessage(), e );
+            } catch ( IOException e ) {
+                throw new RuntimeException ( e.getMessage(), e );
+            } catch ( Exception e ) {
+                throw new RuntimeException ( e.getMessage(), e );
+            } finally {
+                if ( fis != null ) {
+                    try { fis.close(); } catch ( Exception e ) {}
+                }
+            }
+        } else {
+            assert gsub != null;
+            assert gpos != null;
+        }
+        System.err.println ( "compiled " + ( data.size() - 1 ) + " word forms 
using font " + tfn );
+        return data;
+    }
+
+    private static int[] getGlyphs ( GlyphSequence gs ) {
+        IntBuffer gb = gs.getGlyphs();
+        int[] ga = new int [ gb.limit() ];
+        gb.rewind();
+        gb.get ( ga );
+        return ga;
+    }
+
+    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;
+    }
+
+    private static String stripExtension ( String s ) {
+        int i = s.lastIndexOf ( '.' );
+        if ( i >= 0 ) {
+            return s.substring ( 0, i );
+        } else {
+            return s;
+        }
+    }
+
+    private static void output ( String dpn, List<Object[]> data ) {
+        FileOutputStream fos = null;
+        try {
+            fos = new FileOutputStream ( dpn );
+            if ( fos != null ) {
+                ObjectOutputStream oos = new ObjectOutputStream ( fos );
+                oos.writeObject ( data );
+                oos.close();
+            }
+        } catch ( FileNotFoundException e ) {
+            throw new RuntimeException ( e.getMessage(), e );
+        } catch ( IOException e ) {
+            throw new RuntimeException ( e.getMessage(), e );
+        } catch ( Exception e ) {
+            throw new RuntimeException ( e.getMessage(), e );
+        } finally {
+            if ( fos != null ) {
+                try { fos.close(); } catch ( Exception e ) {}
+            }
+        }
+    }
+
+}

Propchange: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/GenerateArabicTestData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/arabic/GenerateArabicTestData.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,8 +19,6 @@
 
 package org.apache.fop.complexscripts.bidi;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -28,11 +26,16 @@ import org.apache.fop.layoutmgr.BidiUtil
 import org.apache.fop.text.bidi.BidiClassUtils;
 import org.apache.fop.util.BidiConstants;
 
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 /**
  * <p>Test case for Unicode Bidi Algorithm.</p>
  * @author Glenn Adams
  */
-public class BidiAlgorithmTestCase extends TestCase {
+public class BidiAlgorithmTestCase {
 
     /**
      * logging instance
@@ -71,6 +74,7 @@ public class BidiAlgorithmTestCase exten
     private int excludedSequences;
     private int passedSequences;
 
+    @Test
     public void testBidiAlgorithm() throws Exception {
         String ldPfx = BidiTestData.LD_PFX;
         int ldCount = BidiTestData.LD_CNT;

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java
 Tue Oct 18 08:33:32 2011
@@ -19,13 +19,17 @@
 
 package org.apache.fop.complexscripts.bidi;
 
-import junit.framework.TestCase;
-
 import org.apache.fop.text.bidi.BidiClassUtils;
 import org.apache.fop.util.CharUtilities;
 
-public class BidiClassTestCase extends TestCase {
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+public class BidiClassTestCase {
 
+    @Test
     public void testBidiClasses() throws Exception {
         String tdPfx = BidiTestData.TD_PFX;
         int tdCount = BidiTestData.TD_CNT;

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiTestSuite.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/bidi/BidiTestSuite.java
 Tue Oct 18 08:33:32 2011
@@ -19,26 +19,17 @@
 
 package org.apache.fop.complexscripts.bidi;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /**
  * Test suite for bidirectional functionality.
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+    BidiClassTestCase.class,
+    BidiAlgorithmTestCase.class
+})
 public class BidiTestSuite {
-
-    /**
-     * Builds the test suite
-     * @return the test suite
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite(
-            "Basic functionality test suite for bidrectional functionality");
-        //$JUnit-BEGIN$
-        suite.addTest(new TestSuite(BidiClassTestCase.class));
-        suite.addTest(new TestSuite(BidiAlgorithmTestCase.class));
-        //$JUnit-END$
-        return suite;
-    }
-
 }

Modified: 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/fonts/FontsTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/fonts/FontsTestSuite.java?rev=1185530&r1=1185529&r2=1185530&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/fonts/FontsTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/complexscripts/fonts/FontsTestSuite.java
 Tue Oct 18 08:33:32 2011
@@ -19,27 +19,24 @@
 
 package org.apache.fop.complexscripts.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.complexscripts.gdef.GDEFTestCase;
+import org.apache.fop.complexscripts.gpos.GPOSTestCase;
+import org.apache.fop.complexscripts.gsub.GSUBTestCase;
 import org.apache.fop.complexscripts.util.TTXFileTestCase;
 
 /**
  * Test suite for fonts functionality related to complex scripts.
  */
+@RunWith(Suite.class)
+@SuiteClasses({
+    TTXFileTestCase.class,
+    GDEFTestCase.class,
+    GSUBTestCase.class,
+    GPOSTestCase.class
+})
 public class FontsTestSuite {
-
-    /**
-     * Builds the test suite
-     * @return the test suite
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite(
-            "Basic functionality test suite for complex scripts fonts related 
functionality");
-        //$JUnit-BEGIN$
-        suite.addTest(new TestSuite(TTXFileTestCase.class));
-        //$JUnit-END$
-        return suite;
-    }
-
 }



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

Reply via email to