From: Joerg Pietschmann Date: Fri, 18 Nov 2005 08:56:06 +0000 (+0000) Subject: XMLified files describing disabled testcases for layout engine and FO tree X-Git-Tag: fop-0_90-alpha1~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ac732c8710ca02a0faf4aeaa73fbf8ada64ad63;p=xmlgraphics-fop.git XMLified files describing disabled testcases for layout engine and FO tree git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@345474 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/build.xml b/build.xml index be516db49..24dd315c8 100644 --- a/build.xml +++ b/build.xml @@ -188,8 +188,10 @@ list of possible build targets. - - + + + + diff --git a/test/fotree/disabled-testcases.xml b/test/fotree/disabled-testcases.xml new file mode 100755 index 000000000..0b13bb1df --- /dev/null +++ b/test/fotree/disabled-testcases.xml @@ -0,0 +1,8 @@ + + + + demo test failure + demo-test-failure.fo + + + diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java index baae0ce28..cad2d4c18 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java @@ -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 index 000000000..2eb9ed880 --- /dev/null +++ b/test/layoutengine/disabled-testcase2filename.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/test/layoutengine/disabled-testcases.dtd b/test/layoutengine/disabled-testcases.dtd new file mode 100755 index 000000000..343362548 --- /dev/null +++ b/test/layoutengine/disabled-testcases.dtd @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml new file mode 100755 index 000000000..e22c8516e --- /dev/null +++ b/test/layoutengine/disabled-testcases.xml @@ -0,0 +1,237 @@ + + + + block-container reference-orientation bug36391 + block-container_reference-orientation_bug36391.xml + + http://issues.apache.org/bugzilla/show_bug.cgi?id=36391 + + + block-container space-before space-after_3 + block-container_space-before_space-after_3.xml + + + + block font-stretch + block_font-stretch.xml + + + + block linefeed-treatment + block_linefeed-treatment.xml + + + + block padding 2 + block_padding_2.xml + + + + block space-before space-after 8 + block_space-before_space-after_8.xml + + + + block white-space-collapse 2 + block_white-space-collapse_2.xml + + + + block white-space-treatment 1 + block_white-space-treatment_1.xml + + + + block white-space-treatment 2 + block_white-space-treatment_2.xml + + + + block word-spacing + block_word-spacing.xml + + + + block word-spacing text-align justify + block_word-spacing_text-align_justify.xml + + + + external-graphic oversized + external-graphic_oversized.xml + + + + external-graphic src uri + external-graphic_src_uri.xml + Doesn't work behind a proxy requiring authorization. + + + footnote space-resolution + footnote_space-resolution.xml + + + + inline block keep-together + inline-block_keep-together.xml + + + + inline block nested 3 + inline_block_nested_3.xml + + + + inline-container block nested + inline-container_block_nested.xml + + + + inline-container border padding + inline-container_border_padding.xml + + + + inline letter-spacing + inline_letter-spacing.xml + + + + inline word-spacing + inline_word-spacing.xml + + + + inline word-spacing text-align justify + inline_word-spacing_text-align_justify.xml + + + + leader alignment + leader-alignment.xml + + + + leader leader-pattern use-content_bug + leader_leader-pattern_use-content_bug.xml + + http://issues.apache.org/bugzilla/show_bug.cgi?id= + + + list-block keep-with-previous + list-block_keep-with-previous.xml + + + + list-item block keep-with-previous + list-item_block_keep-with-previous.xml + + + + marker bug + marker_bug.xml + + http://issues.apache.org/bugzilla/show_bug.cgi?id= + + + page-breaking 4 + page-breaking_4.xml + + + + page-breaking 6 + page-breaking_6.xml + + + + page-height indefinite simple + page-height_indefinite_simple.xml + + + + page-number-citation background-image + page-number-citation_background-image.xml + + + + page-number-citation complex 1 + page-number-citation_complex_1.xml + + + + page-number-citation complex 2 + page-number-citation_complex_2.xml + + + + page-number initial-page-number 2 + page-number_initial-page-number_2.xml + + + + region-body column-count footnote + region-body_column-count_footnote.xml + + + + region-body column-count bug36356 + region-body_column-count_bug36356.xml + + http://issues.apache.org/bugzilla/show_bug.cgi?id=36356 + + + table-body background-image + table-body_background-image.xml + + + + table border-collapse collapse 1 + table_border-collapse_collapse_1.xml + + + + table border-collapse collapse 2 + table_border-collapse_collapse_2.xml + + + + table border padding + table_border_padding.xml + + + + table-cell block keep-with-previous + table-cell_block_keep-with-previous.xml + + + + table-cell_border padding_conditionality + table-cell_border_padding_conditionality.xml + + + + table-column first-row-width + table-column_first-row-width.xml + + + + table-header background-image + table-header_background-image.xml + + + + table-row keep-with-previous + table-row_keep-with-previous.xml + + + + table table-layout fixed 2 + table_table-layout_fixed_2.xml + + + + table border-width conditionality + table_border-width_conditionality.xml + + + \ No newline at end of file