]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
XMLified files describing disabled testcases for layout engine and FO tree
authorJoerg Pietschmann <pietsch@apache.org>
Fri, 18 Nov 2005 08:56:06 +0000 (08:56 +0000)
committerJoerg Pietschmann <pietsch@apache.org>
Fri, 18 Nov 2005 08:56:06 +0000 (08:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@345474 13f79535-47bb-0310-9956-ffa450edef68

build.xml
test/fotree/disabled-testcases.xml [new file with mode: 0755]
test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
test/layoutengine/disabled-testcase2filename.xsl [new file with mode: 0755]
test/layoutengine/disabled-testcases.dtd [new file with mode: 0755]
test/layoutengine/disabled-testcases.xml [new file with mode: 0755]

index be516db49081eeb092d6c5992980679a3f52bfb2..24dd315c8dbd53b3fa93c8ded788b473dab1c7a3 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -188,8 +188,10 @@ list of possible build targets.
 
   <property name="build.property.examples.mime.type" value="application/pdf"/>
 
-  <property name="layoutengine.disabled" value="test/layoutengine/disabled-testcases.txt"/>
-  <property name="fotree.disabled" value="test/fotree/disabled-testcases.txt"/>
+  <!--property name="layoutengine.disabled" value="test/layoutengine/disabled-testcases.txt"/-->
+  <!--property name="fotree.disabled" value="test/fotree/disabled-testcases.txt"/-->
+  <property name="layoutengine.disabled" value="test/layoutengine/disabled-testcases.xml"/>
+  <property name="fotree.disabled" value="test/fotree/disabled-testcases.xml"/>
 
   <property name="dist.bin.dir" value="${basedir}/dist-bin"/>
   <property name="dist.src.dir" value="${basedir}/dist-src"/>
diff --git a/test/fotree/disabled-testcases.xml b/test/fotree/disabled-testcases.xml
new file mode 100755 (executable)
index 0000000..0b13bb1
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<disabled-testcases>
+  <testcase>
+    <name>demo test failure</name>
+    <file>demo-test-failure.fo</file>
+    <description></description>
+  </testcase>
+</disabled-testcases>
index baae0ce28a3c18aa1f90af7538e286c11282e3ad..cad2d4c18d1a9f4fe0e59b61af740d73f3451bbb 100644 (file)
@@ -27,6 +27,15 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamSource;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.filefilter.AndFileFilter;
 import org.apache.commons.io.filefilter.IOFileFilter;
@@ -37,6 +46,10 @@ import org.apache.commons.io.filefilter.SuffixFileFilter;
 import org.apache.commons.io.filefilter.TrueFileFilter;
 import org.apache.fop.DebugHelper;
 
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -61,11 +74,64 @@ public class LayoutEngineTestSuite {
         return (String[])lines.toArray(new String[lines.size()]);
     }
     
+    public static String[] readDisabledTestcases(File f) throws IOException {
+        List lines = new java.util.ArrayList();
+        Source stylesheet = new StreamSource(new File("test/layoutengine/disabled-testcase2filename.xsl"));
+        Source source = new StreamSource(f);
+        Result result = new SAXResult(new FilenameHandler(lines));
+        try {
+            Transformer transformer = TransformerFactory.newInstance().newTransformer(stylesheet);        
+            transformer.transform(source, result);
+        }
+        catch( TransformerConfigurationException tce ) {
+            throw new RuntimeException(tce);
+        }
+        catch( TransformerException te ) {
+            throw new RuntimeException(te);
+        }
+        return (String[])lines.toArray(new String[lines.size()]);
+    }
+    
+    private static class FilenameHandler extends DefaultHandler {
+        private StringBuffer buffer = new StringBuffer(128);
+        private boolean readingFilename =false;
+        private List filenames;
+
+        public FilenameHandler(List filenames) {
+            this.filenames = filenames;
+        }
+
+        public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+            if (qName!=null && qName.equals("file")) {
+                buffer.setLength(0);
+                readingFilename = true;
+            } else {
+                throw new RuntimeException("Unexpected element while reading disabled testcase file names: "+qName);
+            }
+        }
+
+        public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+            if (qName!=null && qName.equals("file")) {
+                readingFilename = false;
+                filenames.add(buffer.toString());
+            } else {
+                throw new RuntimeException("Unexpected element while reading disabled testcase file names: "+qName);
+            }
+        }
+
+        public void characters(char[] ch, int start, int length) throws SAXException {
+            if (readingFilename) {
+                buffer.append(ch,start,length);
+            }
+        }
+    }
+    
     public static IOFileFilter decorateWithDisabledList(IOFileFilter filter) throws IOException {
         String disabled = System.getProperty("fop.layoutengine.disabled");
         if (disabled != null && disabled.length() > 0) {
             filter = new AndFileFilter(new NotFileFilter(
-                    new NameFileFilter(readLinesFromFile(new File(disabled)))),
+//                           new NameFileFilter(readLinesFromFile(new File(disabled)))),
+                           new NameFileFilter(readDisabledTestcases(new File(disabled)))),
                     filter);
         }
         return filter;
diff --git a/test/layoutengine/disabled-testcase2filename.xsl b/test/layoutengine/disabled-testcase2filename.xsl
new file mode 100755 (executable)
index 0000000..2eb9ed8
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Copyright 2005 The Apache Software Foundation\r
+\r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- $Id: testcase2checks.xsl 198226 2005-01-05 21:14:22Z jeremias $ -->\r
+<!-- This stylesheet extracts the checks from the testcase so the list of checks can be built in Java code. -->\r
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">\r
+\r
+  <xsl:template match="/">\r
+    <xsl:copy-of select="disabled-testcases/testcase/file"/>\r
+  </xsl:template>\r
+\r
+</xsl:stylesheet>\r
diff --git a/test/layoutengine/disabled-testcases.dtd b/test/layoutengine/disabled-testcases.dtd
new file mode 100755 (executable)
index 0000000..3433625
--- /dev/null
@@ -0,0 +1,7 @@
+<!ELEMENT disabled-testcases (testcase)*>\r
+<!ELEMENT testcase (name?,file,description?,reference*)>\r
+<!ATTLIST testcase id ID>\r
+<!ELEMENT name #PCDATA>\r
+<!ELEMENT file #PCDATA>\r
+<!ELEMENT description #PCDATA>\r
+<!ELEMENT reference #PCDATA>
\ No newline at end of file
diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml
new file mode 100755 (executable)
index 0000000..e22c851
--- /dev/null
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<disabled-testcases>
+  <testcase>
+    <name>block-container reference-orientation bug36391</name>
+    <file>block-container_reference-orientation_bug36391.xml</file>
+    <description></description>
+    <reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=36391</reference>
+  </testcase>
+  <testcase>
+    <name>block-container space-before space-after_3</name>
+    <file>block-container_space-before_space-after_3.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block font-stretch</name>
+    <file>block_font-stretch.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block linefeed-treatment</name>
+    <file>block_linefeed-treatment.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block padding 2</name>
+    <file>block_padding_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block space-before space-after 8</name>
+    <file>block_space-before_space-after_8.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block white-space-collapse 2</name>
+    <file>block_white-space-collapse_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block white-space-treatment 1</name>
+    <file>block_white-space-treatment_1.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block white-space-treatment 2</name>
+    <file>block_white-space-treatment_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block word-spacing</name>
+    <file>block_word-spacing.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>block word-spacing text-align justify</name>
+    <file>block_word-spacing_text-align_justify.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>external-graphic oversized</name>
+    <file>external-graphic_oversized.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>external-graphic src uri</name>
+    <file>external-graphic_src_uri.xml</file>
+    <description>Doesn't work behind a proxy requiring authorization.</description>
+  </testcase>
+  <testcase>
+    <name>footnote space-resolution</name>
+    <file>footnote_space-resolution.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline block keep-together</name>
+    <file>inline-block_keep-together.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline block nested 3</name>
+    <file>inline_block_nested_3.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline-container block nested</name>
+    <file>inline-container_block_nested.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline-container border padding</name>
+    <file>inline-container_border_padding.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline letter-spacing</name>
+    <file>inline_letter-spacing.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline word-spacing</name>
+    <file>inline_word-spacing.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>inline word-spacing text-align justify</name>
+    <file>inline_word-spacing_text-align_justify.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>leader alignment</name>
+    <file>leader-alignment.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>leader leader-pattern use-content_bug</name>
+    <file>leader_leader-pattern_use-content_bug.xml</file>
+    <description></description>
+    <reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=</reference>
+  </testcase>
+  <testcase>
+    <name>list-block keep-with-previous</name>
+    <file>list-block_keep-with-previous.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>list-item block keep-with-previous</name>
+    <file>list-item_block_keep-with-previous.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>marker bug</name>
+    <file>marker_bug.xml</file>
+    <description></description>
+    <reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=</reference>
+  </testcase>
+  <testcase>
+    <name>page-breaking 4</name>
+    <file>page-breaking_4.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>page-breaking 6</name>
+    <file>page-breaking_6.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>page-height indefinite simple</name>
+    <file>page-height_indefinite_simple.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>page-number-citation background-image</name>
+    <file>page-number-citation_background-image.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>page-number-citation complex 1</name>
+    <file>page-number-citation_complex_1.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>page-number-citation complex 2</name>
+    <file>page-number-citation_complex_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>page-number initial-page-number 2</name>
+    <file>page-number_initial-page-number_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>region-body column-count footnote</name>
+    <file>region-body_column-count_footnote.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>region-body column-count bug36356</name>
+    <file>region-body_column-count_bug36356.xml</file>
+    <description></description>
+    <reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=36356</reference>
+  </testcase>
+  <testcase>
+    <name>table-body background-image</name>
+    <file>table-body_background-image.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table border-collapse collapse 1</name>
+    <file>table_border-collapse_collapse_1.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table border-collapse collapse 2</name>
+    <file>table_border-collapse_collapse_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table border padding</name>
+    <file>table_border_padding.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table-cell block keep-with-previous</name>
+    <file>table-cell_block_keep-with-previous.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table-cell_border padding_conditionality</name>
+    <file>table-cell_border_padding_conditionality.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table-column first-row-width</name>
+    <file>table-column_first-row-width.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table-header background-image</name>
+    <file>table-header_background-image.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table-row keep-with-previous</name>
+    <file>table-row_keep-with-previous.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table table-layout fixed 2</name>
+    <file>table_table-layout_fixed_2.xml</file>
+    <description></description>
+  </testcase>
+  <testcase>
+    <name>table border-width conditionality</name>
+    <file>table_border-width_conditionality.xml</file>
+    <description></description>
+  </testcase>
+</disabled-testcases>
\ No newline at end of file