Pārlūkot izejas kodu

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
tags/fop-0_90-alpha1
Joerg Pietschmann pirms 18 gadiem
vecāks
revīzija
1ac732c871

+ 4
- 2
build.xml Parādīt failu

@@ -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"/>

+ 8
- 0
test/fotree/disabled-testcases.xml Parādīt failu

@@ -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>

+ 67
- 1
test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java Parādīt failu

@@ -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;

+ 25
- 0
test/layoutengine/disabled-testcase2filename.xsl Parādīt failu

@@ -0,0 +1,25 @@
<?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: testcase2checks.xsl 198226 2005-01-05 21:14:22Z jeremias $ -->
<!-- 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="/">
<xsl:copy-of select="disabled-testcases/testcase/file"/>
</xsl:template>
</xsl:stylesheet>

+ 7
- 0
test/layoutengine/disabled-testcases.dtd Parādīt failu

@@ -0,0 +1,7 @@
<!ELEMENT disabled-testcases (testcase)*>
<!ELEMENT testcase (name?,file,description?,reference*)>
<!ATTLIST testcase id ID>
<!ELEMENT name #PCDATA>
<!ELEMENT file #PCDATA>
<!ELEMENT description #PCDATA>
<!ELEMENT reference #PCDATA>

+ 237
- 0
test/layoutengine/disabled-testcases.xml Parādīt failu

@@ -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>

Notiek ielāde…
Atcelt
Saglabāt