aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-01-06 19:17:51 +0000
committerJeremias Maerki <jeremias@apache.org>2005-01-06 19:17:51 +0000
commitff621479067fd6847bfc0ce2db82797e851633c8 (patch)
tree64917eb9c804dc0fd29d65fa069e3ca320c17aa1
parent8dab7badd623fa4c7a3f7745bc501aca578adf6b (diff)
downloadxmlgraphics-fop-ff621479067fd6847bfc0ce2db82797e851633c8.tar.gz
xmlgraphics-fop-ff621479067fd6847bfc0ce2db82797e851633c8.zip
Add ability to optionally specify a simple textfile with a list of filenames of testcases to be disabled (one entry per line).
Specify a filename with that textfile in the system property "fop.layoutengine.disabled". disabled-testcases.txt should serve as our default file for this purpose (ex. in Gump). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198242 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java30
-rw-r--r--test/layoutengine/disabled-testcases.txt1
2 files changed, 29 insertions, 2 deletions
diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
index 6b38839ce..c1a1a9aef 100644
--- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
+++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
@@ -18,13 +18,21 @@
package org.apache.fop.layoutengine;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.filefilter.AndFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.NameFileFilter;
+import org.apache.commons.io.filefilter.NotFileFilter;
import org.apache.commons.io.filefilter.SuffixFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;
@@ -37,10 +45,21 @@ import junit.framework.TestSuite;
*/
public class LayoutEngineTestSuite {
+ private static String[] readLinesFromFile(File f) throws IOException {
+ List lines = new java.util.ArrayList();
+ Reader reader = new FileReader(f);
+ BufferedReader br = new BufferedReader(reader);
+ String line;
+ while ((line = br.readLine()) != null) {
+ lines.add(line);
+ }
+ return (String[])lines.toArray(new String[lines.size()]);
+ }
+
/**
* @return the test suite with all the tests (one for each XML file)
*/
- public static Test suite() {
+ public static Test suite() throws IOException {
TestSuite suite = new TestSuite();
File mainDir = new File("test/layoutengine");
@@ -49,12 +68,19 @@ public class LayoutEngineTestSuite {
final LayoutEngineTester tester = new LayoutEngineTester(backupDir);
- String single = System.getProperty("fop.layoutengine.single");
IOFileFilter filter;
+ String single = System.getProperty("fop.layoutengine.single");
if (single != null) {
filter = new NameFileFilter(single);
} else {
filter = new SuffixFileFilter(".xml");
+ String disabled = System.getProperty("fop.layoutengine.disabled");
+ if (disabled != null && disabled.length() > 0) {
+ filter = new AndFileFilter(new NotFileFilter(
+ new NameFileFilter(readLinesFromFile(new File(disabled)))),
+ filter);
+ }
+
}
Collection files = FileUtils.listFiles(new File(mainDir, "testcases"),
filter, TrueFileFilter.INSTANCE);
diff --git a/test/layoutengine/disabled-testcases.txt b/test/layoutengine/disabled-testcases.txt
new file mode 100644
index 000000000..081a9958f
--- /dev/null
+++ b/test/layoutengine/disabled-testcases.txt
@@ -0,0 +1 @@
+block-nested1.xml \ No newline at end of file