diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-01-05 21:14:22 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-01-05 21:14:22 +0000 |
commit | c5f1859de3bc9f0b06322e63caed66b498d2bfe5 (patch) | |
tree | 27219733c955ec7b76cdacc0ccadc6c49a4aec39 /test | |
parent | 8e1c2320d571833575def45f89e3064e667e4f00 (diff) | |
download | xmlgraphics-fop-c5f1859de3bc9f0b06322e63caed66b498d2bfe5.tar.gz xmlgraphics-fop-c5f1859de3bc9f0b06322e63caed66b498d2bfe5.zip |
Two initial very (!) simple checks for layout engine testing together with supporting stylesheets.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198226 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/layoutengine/testcase2checks.xsl | 32 | ||||
-rw-r--r-- | test/layoutengine/testcase2fo.xsl | 30 | ||||
-rw-r--r-- | test/layoutengine/testcases/basic1.xml | 42 | ||||
-rw-r--r-- | test/layoutengine/testcases/padding1.xml | 41 |
4 files changed, 145 insertions, 0 deletions
diff --git a/test/layoutengine/testcase2checks.xsl b/test/layoutengine/testcase2checks.xsl new file mode 100644 index 000000000..3391ffb08 --- /dev/null +++ b/test/layoutengine/testcase2checks.xsl @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 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:template match="node()|@*" mode="copy"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" mode="copy"/> + </xsl:copy> + </xsl:template> +</xsl:stylesheet> diff --git a/test/layoutengine/testcase2fo.xsl b/test/layoutengine/testcase2fo.xsl new file mode 100644 index 000000000..cb4edb9ae --- /dev/null +++ b/test/layoutengine/testcase2fo.xsl @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 stylesheet extracts the FO part from the testcase so it can be passed to FOP for layout. --> +<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"> + <xsl:apply-templates select="fo/*" mode="copy"/> + </xsl:template> + + <xsl:template match="node()|@*" mode="copy"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" mode="copy"/> + </xsl:copy> + </xsl:template> +</xsl:stylesheet> diff --git a/test/layoutengine/testcases/basic1.xml b/test/layoutengine/testcases/basic1.xml new file mode 100644 index 000000000..9c8b1dfe5 --- /dev/null +++ b/test/layoutengine/testcases/basic1.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 very basic operations. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <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" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>test1</fo:block> + <fo:block>line1<fo:block/>line2</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block/@ipd = '360000'"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding1.xml b/test/layoutengine/testcases/padding1.xml new file mode 100644 index 000000000..b7bbf5bb1 --- /dev/null +++ b/test/layoutengine/testcases/padding1.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 very simple padding operations. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <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" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block margin="0pt" padding-start="5pt">test1</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block/@ipd = '355000'"/> + </checks> +</testcase> |