You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2007/11/06 12:32:53 UTC

svn commit: r592384 - in /xmlgraphics/fop/trunk/test/java/org/apache/fop: fo/flow/table/RowGroupBuilderTestCase.java fotreetest/FOTreeTestSuite.java

Author: vhennebert
Date: Tue Nov  6 03:32:45 2007
New Revision: 592384

URL: http://svn.apache.org/viewvc?rev=592384&view=rev
Log:
Finalised testcase for RowGroupBuilder and added it to the testsuite

Modified:
    xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java?rev=592384&r1=592383&r2=592384&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java Tue Nov  6 03:32:45 2007
@@ -23,7 +23,7 @@
 import java.util.List;
 
 /**
- * Tests that TableRowIterator returns, for each part of a table, the expected number of
+ * Tests that RowGroupBuilder returns, for each part of a table, the expected number of
  * row-groups with the expected number or rows in each.
  */
 public class RowGroupBuilderTestCase extends AbstractTableTestCase {
@@ -33,29 +33,12 @@
     }
 
     /**
-     * Prepares the iterators over the tables contained in the given FO file.
+     * Checks that the given table-body(header,footer) will return row groups as expected.
+     * More precisely, checks that the number of row groups corresponds to the size of the
+     * given array, and that the number of rows inside each row group is equal to the
+     * corresponding integer in the array.
      * 
-     * @param filename basename of a test FO file
-     * @throws Exception
-     */
-//    private void setUp(String filename) throws Exception {
-//        foReader.parse(new File("test/layoutmgr/table/" + filename).toURL().toExternalForm());
-//        List tables = tableHandler.getTables();
-//        List columnSetups = new LinkedList();
-//        tableIterator = tables.iterator();
-//        for (Iterator i = tables.iterator(); i.hasNext();) {
-//            columnSetups.add(new ColumnSetup((Table) i.next()));
-//        }
-//        columnSetupIterator = columnSetups.iterator();
-//    }
-
-    /**
-     * Checks that the given iterator will return row groups as expected. More precisely,
-     * checks that the number of row groups corresponds to the size of the given array,
-     * and that the number of rows inside each row group is equal to the corresponding
-     * integer in the array.
-     * 
-     * @param tri an iterator over a given part of a table (HEADER, FOOTER, BODY)
+     * @param body a body whose row groups are to be checked
      * @param expectedRowLengths expected lengths of all the row groups of this part of
      * the table
      */
@@ -71,7 +54,7 @@
 
     /**
      * Gets the next table and checks its row-groups.
-     * @param tableIter TODO
+     * @param tableIter an iterator over the tables to check
      * @param expectedHeaderRowLengths expected row-group sizes for the header. If null
      * the table is not expected to have a header
      * @param expectedFooterRowLengths expected row-group sizes for the footer. If null
@@ -96,19 +79,6 @@
             assertTrue(bodyIter.hasNext());
             checkTablePartRowGroups((TableBody) bodyIter.next(), expectedBodyRowLengths[i]);
         }
-
-//        ColumnSetup columnSetup = (ColumnSetup) columnSetupIterator.next();
-//        TableRowIterator tri;
-//        if (expectedHeaderRowLengths != null) {
-//            tri = new TableRowIterator(table, columnSetup, TableRowIterator.HEADER);
-//            checkTablePartRowGroups(tri, expectedHeaderRowLengths);
-//        }
-//        if (expectedFooterRowLengths != null) {
-//            tri = new TableRowIterator(table, columnSetup, TableRowIterator.FOOTER);
-//            checkTablePartRowGroups(tri, expectedFooterRowLengths);
-//        }
-//        tri = new TableRowIterator(table, columnSetup, TableRowIterator.BODY);
-//        checkTablePartRowGroups(tri, expectedBodyRowLengths);
     }
 
     public void checkSimple(String filename) throws Exception {
@@ -168,34 +138,34 @@
     }
 
     public void testWithRowsSimple() throws Exception {
-        checkSimple("table/TableRowIterator_simple.fo");
+        checkSimple("table/RowGroupBuilder_simple.fo");
     }
 
     public void testWithRowsSpans() throws Exception {
-        checkSpans("table/TableRowIterator_spans.fo");
+        checkSpans("table/RowGroupBuilder_spans.fo");
     }
 
     public void testNoRowSimple() throws Exception {
-        checkSimple("table/TableRowIterator_no-row_simple.fo");
+        checkSimple("table/RowGroupBuilder_no-row_simple.fo");
     }
 
     public void testNoRowSpans() throws Exception {
-        checkSpans("table/TableRowIterator_no-row_spans.fo");
+        checkSpans("table/RowGroupBuilder_no-row_spans.fo");
     }
 
     public void testNoColWithRowsSimple() throws Exception {
-        checkSimple("table/TableRowIterator_no-col_simple.fo");
+        checkSimple("table/RowGroupBuilder_no-col_simple.fo");
     }
 
     public void testNoColWithRowsSpans() throws Exception {
-        checkSpans("table/TableRowIterator_no-col_spans.fo");
+        checkSpans("table/RowGroupBuilder_no-col_spans.fo");
     }
 
     public void testNoColNoRowSimple() throws Exception {
-        checkSimple("table/TableRowIterator_no-col_no-row_simple.fo");
+        checkSimple("table/RowGroupBuilder_no-col_no-row_simple.fo");
     }
 
     public void testNoColNoRowSpans() throws Exception {
-        checkSpans("table/TableRowIterator_no-col_no-row_spans.fo");
+        checkSpans("table/RowGroupBuilder_no-col_no-row_spans.fo");
     }
 }

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java?rev=592384&r1=592383&r2=592384&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java Tue Nov  6 03:32:45 2007
@@ -24,6 +24,10 @@
 import java.util.Collection;
 import java.util.Iterator;
 
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.filefilter.AndFileFilter;
 import org.apache.commons.io.filefilter.IOFileFilter;
@@ -32,13 +36,11 @@
 import org.apache.commons.io.filefilter.SuffixFileFilter;
 import org.apache.commons.io.filefilter.TrueFileFilter;
 import org.apache.fop.DebugHelper;
+import org.apache.fop.fo.flow.table.RowGroupBuilderTestCase;
+import org.apache.fop.fo.flow.table.TableColumnColumnNumberTestCase;
 import org.apache.fop.fo.flow.table.TooManyColumnsTestCase;
 import org.apache.fop.layoutengine.LayoutEngineTestSuite;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 /**
  * JUnit test suit for running layout engine test under JUnit control.
  */
@@ -109,6 +111,7 @@
 
     private static void addUnitTestCases(TestSuite suite) {
         suite.addTestSuite(TooManyColumnsTestCase.class);
+        suite.addTestSuite(RowGroupBuilderTestCase.class);
     }
 
     private static class FOTreeTestCase extends TestCase {



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org