diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-07-28 21:25:40 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-07-28 21:25:40 +0000 |
commit | 277fe89629513e25b29e31466f5e53a63d5587a9 (patch) | |
tree | 4c74c372db44c4728a79b651008d889ed2bd1498 /test/java/org/apache/fop/layoutengine | |
parent | cc831e2f48711a16e9130b9af6bb73c79f9c0da3 (diff) | |
download | xmlgraphics-fop-277fe89629513e25b29e31466f5e53a63d5587a9.tar.gz xmlgraphics-fop-277fe89629513e25b29e31466f5e53a63d5587a9.zip |
Made the testcase filter available to the outside (for visual testing).
Added support for an optional private-testcases directory which serves as a staging area for new tests and private tests.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@225894 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/layoutengine')
-rw-r--r-- | test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java index 507189dbf..f3fb7ee54 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java @@ -50,7 +50,7 @@ public class LayoutEngineTestSuite { DebugHelper.registerStandardElementListObservers(); } - private static String[] readLinesFromFile(File f) throws IOException { + public static String[] readLinesFromFile(File f) throws IOException { List lines = new java.util.ArrayList(); Reader reader = new FileReader(f); BufferedReader br = new BufferedReader(reader); @@ -61,6 +61,16 @@ public class LayoutEngineTestSuite { return (String[])lines.toArray(new String[lines.size()]); } + 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)))), + filter); + } + return filter; + } + /** * @return the test suite with all the tests (one for each XML file) * @throws IOException in case of an I/O problem @@ -84,16 +94,17 @@ public class LayoutEngineTestSuite { filter = new AndFileFilter(filter, new SuffixFileFilter(".xml")); } 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); - } - + filter = decorateWithDisabledList(filter); } Collection files = FileUtils.listFiles(new File(mainDir, "testcases"), filter, TrueFileFilter.INSTANCE); + String privateTests = System.getProperty("fop.layoutengine.private"); + if ("true".equalsIgnoreCase(privateTests)) { + Collection privateFiles = FileUtils.listFiles( + new File(mainDir, "private-testcases"), + filter, TrueFileFilter.INSTANCE); + files.addAll(privateFiles); + } Iterator i = files.iterator(); while (i.hasNext()) { File f = (File)i.next(); |