aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2007-10-31 15:06:35 +0000
committerVincent Hennebert <vhennebert@apache.org>2007-10-31 15:06:35 +0000
commitfc34b198fd486c5db87e4982b118ba558dcbbedd (patch)
tree3e11525e613b51e7732691a31a8535a3cff0081a /test
parente340490662dcbb38c1ef6771435b8ff4e3721cc1 (diff)
downloadxmlgraphics-fop-fc34b198fd486c5db87e4982b118ba558dcbbedd.tar.gz
xmlgraphics-fop-fc34b198fd486c5db87e4982b118ba558dcbbedd.zip
- Enforced check for proper number of columns in a table. Now if a table has explicit table-columns, those fix the total number of columns and any row having more columns will lead to an error.
- Set up a framework for unit-testing classes from the FO tree, and added some first testcases for the number of columns in tables. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@590705 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/fotree/testcases/column-number_cells_body2.fo34
-rw-r--r--test/fotree/unittests/table/too-many-columns_body_1.fo48
-rw-r--r--test/fotree/unittests/table/too-many-columns_body_2.fo51
-rw-r--r--test/fotree/unittests/table/too-many-columns_body_3.fo56
-rw-r--r--test/java/org/apache/fop/fo/flow/TableHandler.java45
-rw-r--r--test/java/org/apache/fop/fo/flow/TooManyColumnsTestCase.java60
-rw-r--r--test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java14
-rw-r--r--test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java95
-rw-r--r--test/layoutengine/standard-testcases/table-cell_starts-row_ends-row.xml1
-rw-r--r--test/layoutengine/standard-testcases/table-column_missing.xml75
-rw-r--r--test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml2
-rw-r--r--test/layoutengine/standard-testcases/table_border-collapse_collapse_1r2c.xml12
-rw-r--r--test/layoutengine/standard-testcases/table_border-collapse_collapse_nrnc.xml3
-rw-r--r--test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml14
14 files changed, 400 insertions, 110 deletions
diff --git a/test/fotree/testcases/column-number_cells_body2.fo b/test/fotree/testcases/column-number_cells_body2.fo
index d5d1e2e44..ef9d9ad75 100644
--- a/test/fotree/testcases/column-number_cells_body2.fo
+++ b/test/fotree/testcases/column-number_cells_body2.fo
@@ -41,63 +41,55 @@
<fo:table-body>
<fo:table-cell>
<test:assert property="column-number" expected="1" />
- <fo:block>cell1</fo:block>
+ <fo:block>cell 1.1</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="2" />
- <fo:block>cell2</fo:block>
+ <fo:block>cell 1.2</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="3" />
- <fo:block>cell3</fo:block>
+ <fo:block>cell 1.3</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="4" />
- <fo:block>cell4</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <test:assert property="column-number" expected="5" />
- <fo:block>cell5</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <test:assert property="column-number" expected="6" />
- <fo:block>cell5b</fo:block>
+ <fo:block>cell 1.4</fo:block>
</fo:table-cell>
<fo:table-cell starts-row="true">
<test:assert property="column-number" expected="1" />
- <fo:block>cell6</fo:block>
+ <fo:block>cell 2.1</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="2" />
- <fo:block>cell7</fo:block>
+ <fo:block>cell 2.2</fo:block>
</fo:table-cell>
<fo:table-cell ends-row="true">
<test:assert property="column-number" expected="3" />
- <fo:block>cell8</fo:block>
+ <fo:block>cell 2.3</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="1" />
- <fo:block>cell9</fo:block>
+ <fo:block>cell 3.1</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="2" />
- <fo:block>cell10</fo:block>
+ <fo:block>cell 3.2</fo:block>
</fo:table-cell>
<fo:table-cell>
<test:assert property="column-number" expected="3" />
- <fo:block>cell11</fo:block>
+ <fo:block>cell 3.3</fo:block>
</fo:table-cell>
<fo:table-cell ends-row="true">
<test:assert property="column-number" expected="4" />
- <fo:block>cell12</fo:block>
+ <fo:block>cell 3.4</fo:block>
</fo:table-cell>
<fo:table-cell starts-row="true" ends-row="true">
<test:assert property="column-number" expected="1" />
- <fo:block>cell13</fo:block>
+ <fo:block>cell 4.1</fo:block>
</fo:table-cell>
<fo:table-cell ends-row="true">
<test:assert property="column-number" expected="1" />
- <fo:block>cell14</fo:block>
+ <fo:block>cell 5.1</fo:block>
</fo:table-cell>
</fo:table-body>
</fo:table>
diff --git a/test/fotree/unittests/table/too-many-columns_body_1.fo b/test/fotree/unittests/table/too-many-columns_body_1.fo
new file mode 100644
index 000000000..4691c3b7a
--- /dev/null
+++ b/test/fotree/unittests/table/too-many-columns_body_1.fo
@@ -0,0 +1,48 @@
+<?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 row which contains too many
+ columns.</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">
+ <fo:block>Cell 1.2</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.3</fo:block>
+ </fo:table-cell>
+ <fo:table-cell border="1pt solid black" starts-row="true">
+ <fo:block>Cell 2.1</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
diff --git a/test/fotree/unittests/table/too-many-columns_body_2.fo b/test/fotree/unittests/table/too-many-columns_body_2.fo
new file mode 100644
index 000000000..9fe26ab9e
--- /dev/null
+++ b/test/fotree/unittests/table/too-many-columns_body_2.fo
@@ -0,0 +1,51 @@
+<?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 row which contains too many
+ columns.</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">
+ <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-cell border="1pt solid black">
+ <fo:block>Cell 2.3</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
diff --git a/test/fotree/unittests/table/too-many-columns_body_3.fo b/test/fotree/unittests/table/too-many-columns_body_3.fo
new file mode 100644
index 000000000..4ed0098fc
--- /dev/null
+++ b/test/fotree/unittests/table/too-many-columns_body_3.fo
@@ -0,0 +1,56 @@
+<?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 row which contains too many
+ columns.</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-row>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.1</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black">
+ <fo:block>Cell 2.1</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid black" column-number="3">
+ <fo:block>Cell 2.3</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
diff --git a/test/java/org/apache/fop/fo/flow/TableHandler.java b/test/java/org/apache/fop/fo/flow/TableHandler.java
new file mode 100644
index 000000000..c29c33d73
--- /dev/null
+++ b/test/java/org/apache/fop/fo/flow/TableHandler.java
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.fo.FOEventHandler;
+import org.apache.fop.fo.flow.Table;
+
+public class TableHandler extends FOEventHandler {
+
+ /** All the tables encountered in the FO file. List of Table objects. */
+ private List tables = new LinkedList();
+
+ TableHandler(FOUserAgent foUserAgent) {
+ super(foUserAgent);
+ }
+
+ public void endTable(Table tbl) {
+ tables.add(tbl);
+ }
+
+ List getTables() {
+ return tables;
+ }
+}
diff --git a/test/java/org/apache/fop/fo/flow/TooManyColumnsTestCase.java b/test/java/org/apache/fop/fo/flow/TooManyColumnsTestCase.java
new file mode 100644
index 000000000..8c08ddf10
--- /dev/null
+++ b/test/java/org/apache/fop/fo/flow/TooManyColumnsTestCase.java
@@ -0,0 +1,60 @@
+/*
+ * 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;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.fo.FOEventHandler;
+import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fotreetest.FOTreeUnitTester;
+
+public class TooManyColumnsTestCase extends FOTreeUnitTester {
+
+ private FOTreeUnitTester.FOEventHandlerFactory tableHandlerFactory;
+
+ public TooManyColumnsTestCase() throws Exception {
+ super();
+ tableHandlerFactory = new FOTreeUnitTester.FOEventHandlerFactory() {
+ public FOEventHandler createFOEventHandler(FOUserAgent ua) {
+ return new TableHandler(ua);
+ }
+ };
+ }
+
+ private void launchTest(String filename) throws Exception {
+ try {
+ setUp(filename, tableHandlerFactory);
+ fail();
+ } catch (ValidationException e) {
+ // TODO check location
+ }
+ }
+
+ public void testBody1() throws Exception {
+ launchTest("table/too-many-columns_body_1.fo");
+ }
+
+ public void testBody2() throws Exception {
+ launchTest("table/too-many-columns_body_2.fo");
+ }
+
+ public void testBody3() throws Exception {
+ launchTest("table/too-many-columns_body_3.fo");
+ }
+}
diff --git a/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java b/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java
index 0b46a5c66..6ae786439 100644
--- a/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java
+++ b/test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java
@@ -32,6 +32,7 @@ import org.apache.commons.io.filefilter.PrefixFileFilter;
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.TooManyColumnsTestCase;
import org.apache.fop.layoutengine.LayoutEngineTestSuite;
import junit.framework.Test;
@@ -57,7 +58,12 @@ public final class FOTreeTestSuite {
*/
public static Test suite() throws IOException {
TestSuite suite = new TestSuite();
+ addXMLTestCases(suite);
+ addUnitTestCases(suite);
+ return suite;
+ }
+ private static void addXMLTestCases(TestSuite suite) throws IOException {
File mainDir = new File("test/fotree");
final FOTreeTester tester = new FOTreeTester();
@@ -88,8 +94,6 @@ public final class FOTreeTestSuite {
File f = (File)i.next();
addTestCase(suite, tester, f);
}
-
- return suite;
}
private static void addTestCase(TestSuite suite,
@@ -102,7 +106,11 @@ public final class FOTreeTestSuite {
}
});
}
-
+
+ private static void addUnitTestCases(TestSuite suite) {
+ suite.addTestSuite(TooManyColumnsTestCase.class);
+ }
+
private static class FOTreeTestCase extends TestCase {
private FOTreeTester tester;
diff --git a/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java b/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java
new file mode 100644
index 000000000..e19547345
--- /dev/null
+++ b/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java
@@ -0,0 +1,95 @@
+/*
+ * 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.fotreetest;
+
+import java.io.File;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.Fop;
+import org.apache.fop.apps.FopFactory;
+import org.apache.fop.fo.FOEventHandler;
+import org.xml.sax.XMLReader;
+
+
+/**
+ * Base class for unit-testing the FO tree building code. It performs the necessary setup
+ * to parse an FO file and register a proper {@link FOEventHandler}. That handler will be
+ * the entry point to test classes from the FObj hierarchy.
+ */
+public abstract class FOTreeUnitTester extends TestCase {
+
+ private XMLReader foReader;
+
+ private FopFactory fopFactory;
+
+ /**
+ * Should be implemented by children testcases for properly setting up the custom
+ * FOEventHandler needed to test FObj classes.
+ */
+ public abstract static class FOEventHandlerFactory {
+
+ /**
+ * This method is called by FOTreeUnitTester when creating a {@link Fop} instance.
+ * That lets pass to the custom FOEventHandler the proper user agent that will be
+ * used by this instance.
+ *
+ * @param foUserAgent the user agent needed by the Fop instance that will be used
+ * to create the FO tree
+ * @return the appropriate FOEventHandler for performing the tests
+ */
+ public abstract FOEventHandler createFOEventHandler(FOUserAgent foUserAgent);
+ }
+
+ public FOTreeUnitTester() throws Exception {
+ // Stuff that needs to be set up only once and will be re-used for each test
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(false);
+ SAXParser parser;
+ parser = spf.newSAXParser();
+ foReader = parser.getXMLReader();
+ fopFactory = FopFactory.newInstance();
+ }
+
+ /**
+ * Launches FOP on the given FO file.
+ *
+ * @param filename path to the test FO file
+ * @param factory to create the appropriate FOEventHandler for performing tests
+ */
+ public void setUp(String filename, FOEventHandlerFactory factory) throws Exception {
+ FOUserAgent ua = fopFactory.newFOUserAgent();
+ ua.setFOEventHandlerOverride(factory.createFOEventHandler(ua));
+
+ Fop fop = fopFactory.newFop(ua);
+
+ foReader.setContentHandler(fop.getDefaultHandler());
+ foReader.setDTDHandler(fop.getDefaultHandler());
+ foReader.setErrorHandler(fop.getDefaultHandler());
+ foReader.setEntityResolver(fop.getDefaultHandler());
+
+ foReader.parse(new File("test/fotree/unittests/" + filename).toURL().toExternalForm());
+ }
+}
diff --git a/test/layoutengine/standard-testcases/table-cell_starts-row_ends-row.xml b/test/layoutengine/standard-testcases/table-cell_starts-row_ends-row.xml
index 721a7e32a..b22f3e427 100644
--- a/test/layoutengine/standard-testcases/table-cell_starts-row_ends-row.xml
+++ b/test/layoutengine/standard-testcases/table-cell_starts-row_ends-row.xml
@@ -36,6 +36,7 @@
<fo:table-column column-width="1in"/>
<fo:table-column column-width="1in"/>
<fo:table-column column-width="1in"/>
+ <fo:table-column column-width="1in"/>
<fo:table-body>
<fo:table-cell>
<fo:block>cell1</fo:block>
diff --git a/test/layoutengine/standard-testcases/table-column_missing.xml b/test/layoutengine/standard-testcases/table-column_missing.xml
deleted file mode 100644
index 01521bf7b..000000000
--- a/test/layoutengine/standard-testcases/table-column_missing.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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$ -->
-<testcase>
- <info>
- <p>
- This test checks if FOP can handle the case where more columns are actually used than
- specified.
- </p>
- <p>
- Note: This test case is technically wrong since in fixed table layout all
- column-widths must be specified. But we don't want to have FOP crash
- with an IndexOutOfBoundsException either.
- </p>
- </info>
- <fo>
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
- <fo:region-body/>
- </fo:simple-page-master>
- </fo:layout-master-set>
- <fo:page-sequence master-reference="normal">
- <fo:flow flow-name="xsl-region-body">
- <fo:table table-layout="fixed" width="100%" border-collapse="separate">
- <fo:table-column width="2cm"/>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>cell 1/1</fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>cell 2/1</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block>cell 2/2</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block>cell 2/3</fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- </fo:flow>
- </fo:page-sequence>
- </fo:root>
- </fo>
- <checks>
- <eval expected="14400" xpath="//flow/block/block[2]/@top-offset"/>
- <eval expected="14400" xpath="//flow/block/block[3]/@top-offset"/>
- <eval expected="14400" xpath="//flow/block/block[4]/@top-offset"/>
-
- <eval expected="360000" xpath="//flow/block/block[3]/@left-offset"/>
- <eval expected="720000" xpath="//flow/block/block[4]/@left-offset"/>
- <eval expected="360000" xpath="//flow/block/block[3]/@ipd"/>
- <eval expected="360000" xpath="//flow/block/block[4]/@ipd"/>
- </checks>
-</testcase>
diff --git a/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml b/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml
index 623252acc..1a1755c06 100644
--- a/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml
+++ b/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml
@@ -36,7 +36,7 @@
<fo:flow flow-name="xsl-region-body">
<fo:block space-after="80pt">Before the table</fo:block>
<fo:table width="100%" table-layout="fixed" border="4pt solid black">
- <fo:table-column number-columns-repeated="2"
+ <fo:table-column number-columns-repeated="3"
column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
diff --git a/test/layoutengine/standard-testcases/table_border-collapse_collapse_1r2c.xml b/test/layoutengine/standard-testcases/table_border-collapse_collapse_1r2c.xml
index f7f544dd3..816e3f67c 100644
--- a/test/layoutengine/standard-testcases/table_border-collapse_collapse_1r2c.xml
+++ b/test/layoutengine/standard-testcases/table_border-collapse_collapse_1r2c.xml
@@ -35,7 +35,8 @@
<!-- table 1 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="6pt solid black">
@@ -51,7 +52,8 @@
<!-- table 2 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="10pt solid black">
@@ -67,7 +69,8 @@
<!-- table 3 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell
@@ -91,7 +94,8 @@
<!-- table 4 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell
diff --git a/test/layoutengine/standard-testcases/table_border-collapse_collapse_nrnc.xml b/test/layoutengine/standard-testcases/table_border-collapse_collapse_nrnc.xml
index c87cf6e59..aa263f827 100644
--- a/test/layoutengine/standard-testcases/table_border-collapse_collapse_nrnc.xml
+++ b/test/layoutengine/standard-testcases/table_border-collapse_collapse_nrnc.xml
@@ -37,7 +37,8 @@
<!-- table 1 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell
diff --git a/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml b/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml
index 14925e28f..5bc7aed33 100644
--- a/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml
+++ b/test/layoutengine/standard-testcases/table_border-collapse_collapse_spans_1.xml
@@ -35,7 +35,8 @@
<fo:block>Before the tables</fo:block>
<!-- table 1 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-rows-spanned="2"
@@ -69,7 +70,8 @@
<fo:block>Between tables</fo:block>
<!-- table 2 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell
@@ -104,7 +106,8 @@
<fo:block>Between tables</fo:block>
<!-- table 3 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="2"
@@ -142,7 +145,8 @@
<fo:block>Between tables</fo:block>
<!-- table 4 -->
<fo:table table-layout="fixed" width="200pt" border-collapse="collapse">
- <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(1)"
+ number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell
@@ -221,7 +225,7 @@
<eval expected="45200" xpath="//flow/block[2]/block[4]/@bpda"/>
<eval expected="6000" xpath="//flow/block[2]/block[4]/@left-offset"/>
<eval expected="8000" xpath="//flow/block[2]/block[4]/@top-offset"/>
- <!-- cell 1.2 -->
+ <!-- cell 2.2 -->
<eval expected="93000" xpath="//flow/block[2]/block[5]/@ipd"/>
<eval expected="107000" xpath="//flow/block[2]/block[5]/@ipda"/>
<eval expected="28800" xpath="//flow/block[2]/block[5]/@bpd"/>