]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Additional filter possibility for BatchDiffer so previously faulty cases can quickly...
authorJeremias Maerki <jeremias@apache.org>
Mon, 16 Feb 2009 08:28:04 +0000 (08:28 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 16 Feb 2009 08:28:04 +0000 (08:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@744858 13f79535-47bb-0310-9956-ffa450edef68

test/java/org/apache/fop/visual/BatchDiffer.java

index 396657beea23cf55321c79d93e4721a8132bb0cc..08ac886a24d87bc017f5bbc627e698e84e60e567 100644 (file)
@@ -35,8 +35,10 @@ import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.AndFileFilter;
 import org.apache.commons.io.filefilter.IOFileFilter;
 import org.apache.commons.io.filefilter.SuffixFileFilter;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -164,6 +166,14 @@ public class BatchDiffer {
             if (cfg.getChild("filter-disabled").getValueAsBoolean(true)) {
                 filter = LayoutEngineTestSuite.decorateWithDisabledList(filter);
             }
+            String manualFilter = cfg.getChild("manual-filter").getValue(null);
+            if (manualFilter != null) {
+                if (manualFilter.indexOf('*') < 0) {
+                    manualFilter = manualFilter + '*';
+                }
+                filter = new AndFileFilter(
+                        new WildcardFileFilter(manualFilter), filter);
+            }
 
             int maxfiles = cfg.getChild("max-files").getValueAsInteger(-1);
             Collection files = FileUtils.listFiles(srcDir, filter, null);