aboutsummaryrefslogtreecommitdiffstats
path: root/test/java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2007-11-06 11:53:38 +0000
committerVincent Hennebert <vhennebert@apache.org>2007-11-06 11:53:38 +0000
commit335f9a3502c0a8d39a95a599119e6053bc005d3d (patch)
treebdae1fd6adcf5894e212009d5a6ae63e88ec2982 /test/java
parentac5c95850272b55df51f9cb450f1bca44ca65702 (diff)
downloadxmlgraphics-fop-335f9a3502c0a8d39a95a599119e6053bc005d3d.tar.gz
xmlgraphics-fop-335f9a3502c0a8d39a95a599119e6053bc005d3d.zip
Added check for table-cells which span more rows than available in their parent element
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@592392 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r--test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java42
-rw-r--r--test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java48
-rw-r--r--test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java16
3 files changed, 95 insertions, 11 deletions
diff --git a/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java b/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java
new file mode 100644
index 000000000..7327c3324
--- /dev/null
+++ b/test/java/org/apache/fop/fo/flow/table/ErrorCheckTestCase.java
@@ -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
+ }
+ }
+
+}
diff --git a/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java b/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java
new file mode 100644
index 000000000..447b14946
--- /dev/null
+++ b/test/java/org/apache/fop/fo/flow/table/IllegalRowSpanTestCase.java
@@ -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");
+ }
+
+}
diff --git a/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java b/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java
index c28f44ff7..c02f634cd 100644
--- a/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java
+++ b/test/java/org/apache/fop/fo/flow/table/TooManyColumnsTestCase.java
@@ -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");
}
@@ -48,6 +38,10 @@ public class TooManyColumnsTestCase extends AbstractTableTestCase {
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 {
launchTest("table/too-many-columns_header.fo");
}