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:53:40 UTC
svn commit: r592392 - in /xmlgraphics/fop/trunk: ./
src/java/org/apache/fop/fo/flow/table/ test/fotree/unittests/table/
test/java/org/apache/fop/fo/flow/table/
Author: vhennebert
Date: Tue Nov 6 03:53:38 2007
New Revision: 592392
URL: http://svn.apache.org/viewvc?rev=592392&view=rev
Log:
Added check for table-cells which span more rows than available in their parent element
Added:
xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo (with props)
xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo (with props)
xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo (with props)
xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo (with props)
xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java (with props)
xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java (with props)
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java
xmlgraphics/fop/trunk/status.xml
xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java?rev=592392&r1=592391&r2=592392&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java Tue Nov 6 03:53:38 2007
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.apache.fop.fo.ValidationException;
import org.apache.fop.layoutmgr.table.GridUnit;
import org.apache.fop.layoutmgr.table.PrimaryGridUnit;
@@ -113,19 +114,18 @@
}
/**
- * Finishes and records the last row-group of the given table-body, if any. If there
- * is no fo:table-row and the last cell of the table-body didn't have ends-row="true",
- * then the {@link signalNewRow} method has not been called and the last row group has
- * yet to be recorded.
+ * Signals that the end of a table-header/footer/body has been reached. The current
+ * row-group is checked for emptiness. This row group builder is reset for handling
+ * further possible table parts.
*
- * @param tableBody
+ * @param tableBody the table part being finished
+ * @throws ValidationException if a cell is spanning further than the given table part
*/
- void finishLastRowGroup(TableBody tableBody) {
+ void signalEndOfPart(TableBody tableBody) throws ValidationException {
if (rows.size() > 0) {
- tableBody.addRowGroup(rows);
+ throw new ValidationException(
+ "A table-cell is spanning more rows than available in its parent element.");
}
- // Reset, in case this rowGroupBuilder is re-used for other
- // table-header/footer/body
initialize();
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java?rev=592392&r1=592391&r2=592392&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java Tue Nov 6 03:53:38 2007
@@ -57,6 +57,8 @@
private boolean rowsStarted = false;
+ private boolean lastCellEndsRow = true;
+
private List rowGroups = new LinkedList();
/**
@@ -124,7 +126,20 @@
getParent().removeChild(this);
}
} else {
- getTable().getRowGroupBuilder().finishLastRowGroup(this);
+ finishLastRowGroup();
+ }
+ }
+
+ protected void finishLastRowGroup() throws ValidationException {
+ RowGroupBuilder rowGroupBuilder = getTable().getRowGroupBuilder();
+ if (tableRowsFound || !lastCellEndsRow) {
+ rowGroupBuilder.signalRowEnd(this);
+ }
+ try {
+ rowGroupBuilder.signalEndOfPart(this);
+ } catch (ValidationException e) {
+ e.setLocator(locator);
+ throw e;
}
}
@@ -179,7 +194,8 @@
rowsStarted = true;
TableCell cell = (TableCell) child;
addTableCellChild(cell, firstRow);
- if (cell.endsRow()) {
+ lastCellEndsRow = cell.endsRow();
+ if (lastCellEndsRow) {
firstRow = false;
columnNumberManager.prepareForNextRow(pendingSpans);
getTable().getRowGroupBuilder().signalRowEnd(this);
@@ -231,8 +247,7 @@
void signalNewRow() {
if (rowsStarted) {
firstRow = false;
- TableCell previousCell = (TableCell) getChildNodes().lastNode();
- if (!previousCell.endsRow()) {
+ if (!lastCellEndsRow) {
columnNumberManager.prepareForNextRow(pendingSpans);
getTable().getRowGroupBuilder().signalRowEnd(this);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java?rev=592392&r1=592391&r2=592392&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java Tue Nov 6 03:53:38 2007
@@ -51,7 +51,7 @@
if (!(tableRowsFound || tableCellsFound)) {
missingChildElementError("marker* (table-row+|table-cell+)");
} else {
- getTable().getRowGroupBuilder().finishLastRowGroup(this);
+ finishLastRowGroup();
}
// convertCellsToRows();
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java?rev=592392&r1=592391&r2=592392&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java Tue Nov 6 03:53:38 2007
@@ -51,7 +51,7 @@
if (!(tableRowsFound || tableCellsFound)) {
missingChildElementError("marker* (table-row+|table-cell+)");
} else {
- getTable().getRowGroupBuilder().finishLastRowGroup(this);
+ finishLastRowGroup();
}
// convertCellsToRows();
}
Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=592392&r1=592391&r2=592392&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Tue Nov 6 03:53:38 2007
@@ -28,6 +28,10 @@
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="VH" type="add">
+ Added check for table-cells which span more rows than available in their parent element
+ (table-header/footer/body).
+ </action>
<action context="Code" dev="AD" type="add">
Added support for fo:markers in fo:inline and fo:basic-link.
</action>
Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo?rev=592392&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo Tue Nov 6 03:53:38 2007
@@ -0,0 +1,42 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ 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$ -->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">The following table has a cell which spans further than its
+ containing table-body.</fo:block>
+ <fo:table table-layout="fixed" border-collapse="separate" width="100%">
+ <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
+ <fo:table-body>
+ <fo:table-cell border="1pt solid black" number-rows-spanned="2">
+ <fo:block>Cell 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_1.fo
------------------------------------------------------------------------------
svn:keywords = Id
Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo?rev=592392&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo Tue Nov 6 03:53:38 2007
@@ -0,0 +1,66 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ 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$ -->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">The following table has a cell which spans further than its
+ containing table-body.</fo:block>
+ <fo:table table-layout="fixed" border-collapse="separate" width="100%">
+ <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
+ <fo:table-body>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" ends-row="true">
+ <fo:block>Cell 1.2</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" number-rows-spanned="2">
+ <fo:block>Cell 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 3.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 3.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 4.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 4.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_body_2.fo
------------------------------------------------------------------------------
svn:keywords = Id
Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo?rev=592392&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo Tue Nov 6 03:53:38 2007
@@ -0,0 +1,75 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ 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$ -->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">The following table has a cell which spans further than its
+ containing table-footer.</fo:block>
+ <fo:table table-layout="fixed" border-collapse="separate" width="100%">
+ <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
+ <fo:table-header>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-header>
+ <fo:table-footer>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Footer 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" ends-row="true">
+ <fo:block>Footer 1.2</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Footer 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" number-rows-spanned="3">
+ <fo:block>Footer 2.2</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" starts-row="true">
+ <fo:block>Footer 3.1</fo:block>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" ends-row="true">
+ <fo:block>Cell 1.2</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_footer.fo
------------------------------------------------------------------------------
svn:keywords = Id
Added: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo?rev=592392&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo (added)
+++ xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo Tue Nov 6 03:53:38 2007
@@ -0,0 +1,81 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ 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$ -->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page" page-height="10cm" page-width="15cm" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">The following table has a cell which spans further than its
+ containing table-header.</fo:block>
+ <fo:table table-layout="fixed" border-collapse="separate" width="100%">
+ <fo:table-column number-columns-repeated="2" column-width="proportional-column-width(1)"/>
+ <fo:table-header>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black" number-rows-spanned="3">
+ <fo:block>Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Header 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-header>
+ <fo:table-body>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" ends-row="true">
+ <fo:block>Cell 1.2</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 3.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 3.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 4.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid blue">
+ <fo:block>Cell 4.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/fotree/unittests/table/illegal-row-span_header.fo
------------------------------------------------------------------------------
svn:keywords = Id
Added: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java?rev=592392&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java (added)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java Tue Nov 6 03:53:38 2007
@@ -0,0 +1,42 @@
+/*
+ * 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.fo.flow.table;
+
+import org.apache.fop.fo.ValidationException;
+
+/**
+ * Abstract class for testing erroneous files, checking that a ValidationException is thrown.
+ */
+abstract class ErrorCheckTestCase extends AbstractTableTestCase {
+
+ public ErrorCheckTestCase() throws Exception {
+ super();
+ }
+
+ protected void launchTest(String filename) throws Exception {
+ try {
+ setUp(filename);
+ fail();
+ } catch (ValidationException e) {
+ // TODO check location
+ }
+ }
+
+}
Propchange: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java?rev=592392&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java (added)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java Tue Nov 6 03:53:38 2007
@@ -0,0 +1,48 @@
+/*
+ * 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.fo.flow.table;
+
+/**
+ * Testcase checking that cells spanning further than their parent element aren't
+ * accepted.
+ */
+public class IllegalRowSpanTestCase extends ErrorCheckTestCase {
+
+ public IllegalRowSpanTestCase() throws Exception {
+ super();
+ }
+
+ public void testBody1() throws Exception {
+ launchTest("table/illegal-row-span_body_1.fo");
+ }
+
+ public void testBody2() throws Exception {
+ launchTest("table/illegal-row-span_body_2.fo");
+ }
+
+ public void testHeader() throws Exception {
+ launchTest("table/illegal-row-span_header.fo");
+ }
+
+ public void testFooter() throws Exception {
+ launchTest("table/illegal-row-span_footer.fo");
+ }
+
+}
Propchange: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java?rev=592392&r1=592391&r2=592392&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java Tue Nov 6 03:53:38 2007
@@ -19,23 +19,13 @@
package org.apache.fop.fo.flow.table;
-import org.apache.fop.fo.ValidationException;
-public class TooManyColumnsTestCase extends AbstractTableTestCase {
+public class TooManyColumnsTestCase extends ErrorCheckTestCase {
public TooManyColumnsTestCase() throws Exception {
super();
}
- private void launchTest(String filename) throws Exception {
- try {
- setUp(filename);
- fail();
- } catch (ValidationException e) {
- // TODO check location
- }
- }
-
public void testBody1() throws Exception {
launchTest("table/too-many-columns_body_1.fo");
}
@@ -46,6 +36,10 @@
public void testBody3() throws Exception {
launchTest("table/too-many-columns_body_3.fo");
+ }
+
+ public void testBody4() throws Exception {
+ launchTest("table/too-many-columns_body_4.fo");
}
public void testHeader() throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org