aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-06-30 14:11:56 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-06-30 14:11:56 +0000
commit81a04fe6cbbac40d08297f49fc2801ac58b36640 (patch)
tree3435c80aee45b4cadfe429225e7c6dcf29dcf765 /test
parentb0cd543ff8311a4b1f61bbc43371f85fd6120883 (diff)
downloadxmlgraphics-fop-81a04fe6cbbac40d08297f49fc2801ac58b36640.tar.gz
xmlgraphics-fop-81a04fe6cbbac40d08297f49fc2801ac58b36640.zip
Merged revisions 672495-672496,672499,672537,672539,672564-672565,672617-672618,672670 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r672495 | adelmelle | 2008-06-28 12:22:58 +0100 (Sat, 28 Jun 2008) | 1 line Removed unnecessary override ........ r672496 | adelmelle | 2008-06-28 12:24:20 +0100 (Sat, 28 Jun 2008) | 1 line Added testcase for r672010 ........ r672499 | adelmelle | 2008-06-28 13:11:40 +0100 (Sat, 28 Jun 2008) | 3 lines Added basic-checks.xml: file currently only contains one default check. Modified testcase2checks.xsl: the added basic-checks.xml will be inserted before the checks particular to the testcase. ........ r672537 | acumiskey | 2008-06-28 17:05:08 +0100 (Sat, 28 Jun 2008) | 1 line Corrected minor spelling mistake in javadoc ........ r672539 | acumiskey | 2008-06-28 17:08:13 +0100 (Sat, 28 Jun 2008) | 1 line Corrected minor spelling mistake in javadoc ........ r672564 | adelmelle | 2008-06-28 19:39:39 +0100 (Sat, 28 Jun 2008) | 1 line Corrected basic checks: check for empty document, as well as empty areaTree... ........ r672565 | adelmelle | 2008-06-28 19:45:16 +0100 (Sat, 28 Jun 2008) | 1 line Removed instream-foreign-object in marker; still threw a NPE ........ r672617 | adelmelle | 2008-06-29 11:52:30 +0100 (Sun, 29 Jun 2008) | 1 line Added disabled testcase for instream-foreign-object in a marker ........ r672618 | adelmelle | 2008-06-29 11:58:31 +0100 (Sun, 29 Jun 2008) | 2 lines Correct svn props ........ r672670 | adelmelle | 2008-06-29 20:53:17 +0100 (Sun, 29 Jun 2008) | 1 line Cleanup/re-ordering, and addition of XSL 1.1 FO_ and PR_ constants ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@672777 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/layoutengine/basic-checks.xml25
-rw-r--r--test/layoutengine/disabled-testcases.xml5
-rw-r--r--test/layoutengine/standard-testcases/marker_instream-foreign-object.xml83
-rw-r--r--test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml95
-rw-r--r--test/layoutengine/testcase2checks.xsl24
5 files changed, 222 insertions, 10 deletions
diff --git a/test/layoutengine/basic-checks.xml b/test/layoutengine/basic-checks.xml
new file mode 100644
index 000000000..529a53cf7
--- /dev/null
+++ b/test/layoutengine/basic-checks.xml
@@ -0,0 +1,25 @@
+<?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$ -->
+<!--
+ This file contains basic checks that are performed for every tescase
+-->
+<checks>
+ <true xpath="boolean(/areaTree)" />
+ <true xpath="boolean(/areaTree/*)" />
+</checks>
diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml
index ca05b156b..7bf441d5b 100644
--- a/test/layoutengine/disabled-testcases.xml
+++ b/test/layoutengine/disabled-testcases.xml
@@ -223,4 +223,9 @@
relaxed validation must be switched on, otherwise there is a validation
exception.</description>
</testcase>
+ <testcase>
+ <name>Instream foreign objects in markers</name>
+ <file>marker_instream-foreign-object.xml</file>
+ <description>Foreign objects in markers do not work.</description>
+ </testcase>
</disabled-testcases>
diff --git a/test/layoutengine/standard-testcases/marker_instream-foreign-object.xml b/test/layoutengine/standard-testcases/marker_instream-foreign-object.xml
new file mode 100644
index 000000000..796f2d72a
--- /dev/null
+++ b/test/layoutengine/standard-testcases/marker_instream-foreign-object.xml
@@ -0,0 +1,83 @@
+<?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 for fo:instream-foreign-object in fo:markers.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="first"
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm">
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-before extent="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="first" initial-page-number="1">
+ <fo:static-content flow-name="xsl-region-before">
+ <fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute">
+ <fo:block font-size="0pt">
+ <fo:retrieve-marker retrieve-class-name="mark"
+ retrieve-boundary="page"
+ retrieve-position="last-ending-within-page"/>
+ </fo:block>
+ </fo:block-container>
+ </fo:static-content>
+ <fo:static-content flow-name="xsl-region-after">
+ <fo:block text-align="start" font-size="10pt" font-family="serif" line-height="1em + 2pt">
+ Page (<fo:page-number/> / <fo:page-number-citation ref-id="end-of-document"/>)
+ </fo:block>
+ </fo:static-content>
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block text-align="start" font-size="12pt" font-family="sans-serif">
+ Some text.
+ </fo:block>
+ <fo:block id="end-of-document">
+ <fo:marker marker-class-name="mark">
+ <fo:instream-foreign-object width="15cm" height="1cm" id="ifo1">
+ <svg xmlns="http://www.w3.org/2000/svg" width="15cm" height="1cm" xml:space="preserve">
+ <rect style="fill:red;stroke:red" x="0" y="0" width="15cm" height="1cm"/>
+ </svg>
+ </fo:instream-foreign-object>
+ </fo:marker>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- check whether the i-f-o viewport exists -->
+ <true xpath="boolean(//viewport[@prod-id='ifo1'])" fail-msg="foreign object viewport not found" />
+ <!-- check whether the i-f-o viewport has any content -->
+ <true xpath="boolean(//viewport[@prod-id='ifo1']/*)" fail-msg="foreign object not rendered" />
+ <!-- check whether the foreign object itself survives marker-cloning -->
+ <eval expected="1" xpath="count(//foreignObject[@prod-id='ifo1'][1]/*)" />
+ <eval expected="svg" xpath="local-name(//foreignObject[@prod-id='ifo1'][1]/*[1])" />
+ <eval expected="1" xpath="count(//foreignObject[@prod-id='ifo1'][1]/*/*)" />
+ <eval expected="rect" xpath="local-name(//foreignObject[@prod-id='ifo1'][1]/*[1]/*[1])" />
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml b/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml
new file mode 100644
index 000000000..28d684127
--- /dev/null
+++ b/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml
@@ -0,0 +1,95 @@
+<?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 for resolution of forward references in
+ fo:markers, as reported in Bugzilla 45295.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="first"
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm">
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-before extent="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="first" initial-page-number="1">
+ <fo:static-content flow-name="xsl-region-before">
+ <fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute">
+ <fo:block>
+ <fo:retrieve-marker retrieve-class-name="message"
+ retrieve-boundary="page"
+ retrieve-position="first-starting-within-page"/>
+ </fo:block>
+ </fo:block-container>
+ <fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute">
+ <fo:block>
+ <fo:retrieve-marker retrieve-class-name="term"
+ retrieve-boundary="page"
+ retrieve-position="last-ending-within-page"/>
+ </fo:block>
+ </fo:block-container>
+ </fo:static-content>
+ <fo:static-content flow-name="xsl-region-after">
+ <fo:block text-align="start" font-size="10pt" font-family="serif" line-height="1em + 2pt">
+ Page (<fo:page-number/> / <fo:page-number-citation ref-id="end-of-document"/>)
+ </fo:block>
+ </fo:static-content>
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>
+ <fo:marker marker-class-name="message">
+ <fo:block>
+ WARNING: Page sequence contains: <fo:page-number-citation id="pnc1" ref-id="end-of-document"/> pages.
+ </fo:block>
+ </fo:marker>
+ </fo:block>
+ <fo:block text-align="start" font-size="12pt" font-family="sans-serif">
+ This page sequence has more than one page so you will see the message only at the top of the first page.
+ </fo:block>
+ <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif">
+ Some text.
+ </fo:block>
+ <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif">
+ Some text.
+ </fo:block>
+ <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif">
+ Some more text on last page.
+ </fo:block>
+ <fo:block id="end-of-document">
+ <fo:marker marker-class-name="term">
+ [marker content]
+ </fo:marker>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <true xpath="//text[@prod-id='pnc1'][1]/word = '4'" />
+ </checks>
+</testcase>
diff --git a/test/layoutengine/testcase2checks.xsl b/test/layoutengine/testcase2checks.xsl
index 00fc9d47b..cb31d583a 100644
--- a/test/layoutengine/testcase2checks.xsl
+++ b/test/layoutengine/testcase2checks.xsl
@@ -19,15 +19,19 @@
<!-- This stylesheet extracts the checks from the testcase so the list of checks can be built in Java code. -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <xsl:template match="testcase">
- <checks>
- <xsl:apply-templates select="checks/*" mode="copy"/>
- </checks>
- </xsl:template>
+<xsl:variable name="basic-checks" select="document('basic-checks.xml')/checks/*" />
+
+<xsl:template match="testcase">
+ <xsl:apply-templates select="checks" />
+</xsl:template>
+
+<xsl:template match="checks">
+ <checks>
+ <xsl:copy-of select="$basic-checks" />
+ <xsl:copy-of select="*" />
+ </checks>
+</xsl:template>
+
+<xsl:template match="text()" />
- <xsl:template match="node()|@*" mode="copy">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()" mode="copy"/>
- </xsl:copy>
- </xsl:template>
</xsl:stylesheet>