commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mart...@apache.org
Subject cvs commit: jakarta-commons/io/src/test/org/apache/commons/io/filefilter AndFileFilterTestCase.java ConditionalFileFilterAbstractTestCase.java IOFileFilterAbstractTestCase.java OrFileFilterTestCase.java
Date Sun, 24 Oct 2004 21:58:44 GMT
martinc     2004/10/24 14:58:44

  Modified:    io       build.xml project.xml
               io/src/java/org/apache/commons/io/filefilter
                        AndFileFilter.java OrFileFilter.java
  Added:       io/src/java/org/apache/commons/io/filefilter
                        ConditionalFileFilter.java
               io/src/test/org/apache/commons/io/filefilter
                        AndFileFilterTestCase.java
                        ConditionalFileFilterAbstractTestCase.java
                        IOFileFilterAbstractTestCase.java
                        OrFileFilterTestCase.java
  Log:
  Bug #30705 - Add conditional file filters.
  
  I effectively merged these new filters into the existing And and Or
  filters, rather than having multiple flavours of them. In practice, this
  means that I added the contructors from the original filters to these new
  ones, and then replaced the old with the new. All of the pre-existing
  tests work with the resulting filters, along with all the new tests
  supplied with the enhancement request. Thanks to Steven Caswell for the
  code.
  
  I also had to exclude the abstract test cases in the Maven build file, so
  that JUnit wouldn't try to instantiate and run them, and regenerate the
  Ant build file.
  
  Revision  Changes    Path
  1.19      +3 -1      jakarta-commons/io/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/io/build.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- build.xml	24 Oct 2004 00:51:53 -0000	1.18
  +++ build.xml	24 Oct 2004 21:58:44 -0000	1.19
  @@ -1,7 +1,7 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
   <!--build.xml generated by maven from project.xml version 1.1-dev
  -  on date October 23 2004, time 1747-->
  +  on date October 24 2004, time 1323-->
   
   <project default="jar" name="commons-io" basedir=".">
     <property name="defaulttargetdir" value="target">
  @@ -106,6 +106,8 @@
           <fileset dir="src/test">
             <include name="**/*Test*">
             </include>
  +          <exclude name="**/*AbstractTestCase*">
  +          </exclude>
             <exclude name="**/testtools/**">
             </exclude>
           </fileset>
  
  
  
  1.33      +1 -0      jakarta-commons/io/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/io/project.xml,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- project.xml	24 Oct 2004 00:51:53 -0000	1.32
  +++ project.xml	24 Oct 2004 21:58:44 -0000	1.33
  @@ -183,6 +183,7 @@
           <include>**/*Test*</include>
         </includes>
         <excludes>
  +        <exclude>**/*AbstractTestCase*</exclude>
           <exclude>**/testtools/**</exclude>
         </excludes>
       </unitTest>
  
  
  
  1.9       +109 -46   jakarta-commons/io/src/java/org/apache/commons/io/filefilter/AndFileFilter.java
  
  Index: AndFileFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/io/src/java/org/apache/commons/io/filefilter/AndFileFilter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AndFileFilter.java	23 Feb 2004 04:37:57 -0000	1.8
  +++ AndFileFilter.java	24 Oct 2004 21:58:44 -0000	1.9
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002-2004 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.
  @@ -16,56 +16,119 @@
   package org.apache.commons.io.filefilter;
   
   import java.io.File;
  +import java.util.ArrayList;
  +import java.util.Collections;
  +import java.util.Iterator;
  +import java.util.List;
   
   /**
  - * This filter produces a logical AND of the two filters specified.
  + * A {@link FileFilter} providing conditional AND logic across a list of
  + * file filters. This filter returns <code>true</code> if all filters in the
  + * list return <code>true</code>. Otherwise, it returns <code>false</code>.
  + * Checking of the file filter list stops when the first filter returns
  + * <code>false</code>.
    *
    * @since Commons IO 1.0
    * @version $Revision$ $Date$
  - * 
  - * @author Stephen Colebourne
  + *
  + * @author  Steven Caswell
    */
  -public class AndFileFilter extends AbstractFileFilter {
  -    
  -    /** The first filter */
  -    private IOFileFilter filter1;
  -    /** The second filter */
  -    private IOFileFilter filter2;
  -
  -    /**
  -     * Constructs a new file filter that ANDs the result of two other filters.
  -     * 
  -     * @param filter1  the first filter, must not be null
  -     * @param filter2  the second filter, must not be null
  -     * @throws IllegalArgumentException if either filter is null
  -     */
  -    public AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) {
  -        if (filter1 == null || filter2 == null) {
  -            throw new IllegalArgumentException("The filters must not be null");
  -        }
  -        this.filter1 = filter1;
  -        this.filter2 = filter2;
  +public class AndFileFilter
  +extends AbstractFileFilter
  +implements IOFileFilter, ConditionalFileFilter {
  +
  +  private List fileFilters;
  +
  +  /**
  +   * Constructs a new instance of <code>AndFileFilter</code>.
  +   */
  +  public AndFileFilter() {
  +    this.fileFilters = new ArrayList();
  +  }
  +
  +  /**
  +   * Constructs a new instance of <code>AndFileFilter</code>
  +   * with the specified list of filters.
  +   */
  +  public AndFileFilter(final List fileFilters) {
  +    this.fileFilters = new ArrayList(fileFilters);
  +  }
  +
  +  /**
  +   * Constructs a new file filter that ANDs the result of two other filters.
  +   *
  +   * @param filter1  the first filter, must not be null
  +   * @param filter2  the second filter, must not be null
  +   * @throws IllegalArgumentException if either filter is null
  +   */
  +  public AndFileFilter(IOFileFilter filter1, IOFileFilter filter2) {
  +      if (filter1 == null || filter2 == null) {
  +          throw new IllegalArgumentException("The filters must not be null");
  +      }
  +      this.fileFilters = new ArrayList();
  +      addFileFilter(filter1);
  +      addFileFilter(filter2);
  +  }
  +
  +  /**
  +   * @{inheritDoc}
  +   */
  +  public void addFileFilter(final IOFileFilter ioFileFilter) {
  +    this.fileFilters.add(ioFileFilter);
  +  }
  +
  +  /**
  +   * @{inheritDoc}
  +   */
  +  public List getFileFilters() {
  +    return Collections.unmodifiableList(this.fileFilters);
  +  }
  +
  +  /**
  +   * @{inheritDoc}
  +   */
  +  public boolean removeFileFilter(final IOFileFilter ioFileFilter) {
  +    return this.fileFilters.remove(ioFileFilter);
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public void setFileFilters(final List fileFilters) {
  +    this.fileFilters = new ArrayList(fileFilters);
  +  }
  +
  +  /**
  +   * @{inheritDoc}
  +   */
  +  public boolean accept(final File file) {
  +    if(this.fileFilters.size() == 0) {
  +      return false;
  +    }
  +    for(Iterator iter = this.fileFilters.iterator(); iter.hasNext();) {
  +      IOFileFilter fileFilter = (IOFileFilter) iter.next();
  +      if(!fileFilter.accept(file)) {
  +        return false;
  +      }
       }
  +    return true;
  +  }
   
  -    /**
  -     * Checks to see if both filters are true.
  -     * 
  -     * @param file  the File to check
  -     * @return true if both filters are true
  -     */
  -    public boolean accept(File file) {
  -        return filter1.accept(file) && filter2.accept(file);
  +  /**
  +   * @{inheritDoc}
  +   */
  +  public boolean accept(final File file, final String name)
  +  {
  +    if(this.fileFilters.size() == 0) {
  +      return false;
       }
  -    
  -    /**
  -     * Checks to see if both filters are true.
  -     * 
  -     * @param file  the File directory
  -     * @param name  the filename
  -     * @return true if both filters are true
  -     */
  -    public boolean accept(File file, String name) {
  -        return filter1.accept(file, name) && filter2.accept(file, name);
  +    for(Iterator iter = this.fileFilters.iterator(); iter.hasNext();) {
  +      IOFileFilter fileFilter = (IOFileFilter) iter.next();
  +      if(!fileFilter.accept(file, name)) {
  +        return false;
  +      }
       }
  -    
  +    return true;
  +  }
  +
   }
  
  
  
  1.9       +104 -47   jakarta-commons/io/src/java/org/apache/commons/io/filefilter/OrFileFilter.java
  
  Index: OrFileFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/io/src/java/org/apache/commons/io/filefilter/OrFileFilter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- OrFileFilter.java	23 Feb 2004 04:37:57 -0000	1.8
  +++ OrFileFilter.java	24 Oct 2004 21:58:44 -0000	1.9
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002-2004 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.
  @@ -16,56 +16,113 @@
   package org.apache.commons.io.filefilter;
   
   import java.io.File;
  +import java.util.ArrayList;
  +import java.util.Collections;
  +import java.util.Iterator;
  +import java.util.List;
   
   /**
  - * This filter produces a logical OR of the two filters specified.
  + * A {@link FileFilter} providing conditional OR logic across a list of
  + * file filters. This filter returns <code>true</code> if any filters in the
  + * list return <code>true</code>. Otherwise, it returns <code>false</code>.
  + * Checking of the file filter list stops when the first filter returns
  + * <code>true</code>.
    *
    * @since Commons IO 1.0
    * @version $Revision$ $Date$
  - * 
  - * @author Stephen Colebourne
  + *
  + * @author  Steven Caswell
    */
  -public class OrFileFilter extends AbstractFileFilter {
  -    
  -    /** The first filter */
  -    private IOFileFilter filter1;
  -    /** The second filter */
  -    private IOFileFilter filter2;
  -
  -    /**
  -     * Constructs a new file filter that ORs the result of two other filters.
  -     * 
  -     * @param filter1  the first filter, must not be null
  -     * @param filter2  the second filter, must not be null
  -     * @throws IllegalArgumentException if either filter is null
  -     */
  -    public OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) {
  -        if (filter1 == null || filter2 == null) {
  -            throw new IllegalArgumentException("The filters must not be null");
  -        }
  -        this.filter1 = filter1;
  -        this.filter2 = filter2;
  -    }
  +public class OrFileFilter
  +  extends AbstractFileFilter
  +  implements IOFileFilter, ConditionalFileFilter {
  +
  +  private List fileFilters;
  +
  +  /**
  +   * Constructs a new instance of <code>OrFileFilter</code>.
  +   */
  +  public OrFileFilter() {
  +    this.fileFilters = new ArrayList();
  +  }
   
  -    /**
  -     * Checks to see if either filter is true.
  -     * 
  -     * @param file  the File to check
  -     * @return true if either filter is true
  -     */
  -    public boolean accept(File file) {
  -        return filter1.accept(file) || filter2.accept(file);
  +  /**
  +   * Constructs a new instance of <code>OrFileFilter</code>
  +   * with the specified filters.
  +   *
  +   * @param fileFileter the file filters for this filter
  +   */
  +  public OrFileFilter(final List fileFilters) {
  +    this.fileFilters = new ArrayList(fileFilters);
  +  }
  +
  +  /**
  +   * Constructs a new file filter that ORs the result of two other filters.
  +   * 
  +   * @param filter1  the first filter, must not be null
  +   * @param filter2  the second filter, must not be null
  +   * @throws IllegalArgumentException if either filter is null
  +   */
  +  public OrFileFilter(IOFileFilter filter1, IOFileFilter filter2) {
  +      if (filter1 == null || filter2 == null) {
  +          throw new IllegalArgumentException("The filters must not be null");
  +      }
  +      this.fileFilters = new ArrayList();
  +      addFileFilter(filter1);
  +      addFileFilter(filter2);
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public void addFileFilter(final IOFileFilter ioFileFilter) {
  +    this.fileFilters.add(ioFileFilter);
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public List getFileFilters() {
  +    return Collections.unmodifiableList(this.fileFilters);
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public boolean removeFileFilter(IOFileFilter ioFileFilter) {
  +    return this.fileFilters.remove(ioFileFilter);
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public void setFileFilters(final List fileFilters) {
  +    this.fileFilters = fileFilters;
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public boolean accept(final File file) {
  +    for(Iterator iter = this.fileFilters.iterator(); iter.hasNext();) {
  +      IOFileFilter fileFilter = (IOFileFilter) iter.next();
  +      if(fileFilter.accept(file)) {
  +        return true;
  +      }
       }
  -    
  -    /**
  -     * Checks to see if either filter is true.
  -     * 
  -     * @param file  the File directory
  -     * @param name  the filename
  -     * @return true if either filter is true
  -     */
  -    public boolean accept(File file, String name) {
  -        return filter1.accept(file, name) || filter2.accept(file, name);
  +    return false;
  +  }
  +
  +  /**
  +   * {@inheritDoc}
  +   */
  +  public boolean accept(final File file, final String name) {
  +    for(Iterator iter = this.fileFilters.iterator(); iter.hasNext();) {
  +      IOFileFilter fileFilter = (IOFileFilter) iter.next();
  +      if(fileFilter.accept(file, name)) {
  +        return true;
  +      }
       }
  -    
  +    return false;
  +  }
   }
  
  
  
  1.1                  jakarta-commons/io/src/java/org/apache/commons/io/filefilter/ConditionalFileFilter.java
  
  Index: ConditionalFileFilter.java
  ===================================================================
  /*
   * Copyright 2002-2004 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.
   */
  package org.apache.commons.io.filefilter;
  
  import java.util.List;
  
  /**
   * Defines operations for conditional file filters.
   *
   * @since Commons IO 1.0
   * @version $Revision: 1.1 $ $Date: 2004/10/24 21:58:44 $
   *
   * @author  Steven Caswell
   */
  public interface ConditionalFileFilter
  {
    /**
     * Adds the specified file filter to the list of file filters at the end of
     * the list.
     *
     * @param ioFileFilter the filter to be added
     */
    public void addFileFilter(IOFileFilter ioFileFilter);
  
    /**
     * Returns this conditional file filter's list of file filters.
     *
     * @return the file filter list
     */
    public List getFileFilters();
    
    /**
     * Removes the specified file filter.
     *
     * @param ioFileFilter filter to be removed
     * @return <code>true</code> if the filter was found in the list,
     * <code>false</code> otherwise
     */
    public boolean removeFileFilter(IOFileFilter ioFileFilter);
  
    /**
     * Sets the list of file filters, replacing any previously configured
     * file filters on this filter.
     *
     * @param fileFilters the list of filters
     */
    public void setFileFilters(List fileFilters);
    
  }
  
  
  
  1.1                  jakarta-commons/io/src/test/org/apache/commons/io/filefilter/AndFileFilterTestCase.java
  
  Index: AndFileFilterTestCase.java
  ===================================================================
  /*
   * Copyright 2002-2004 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.
   */
  package org.apache.commons.io.filefilter;
  
  import java.util.ArrayList;
  import java.util.List;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  public class AndFileFilterTestCase extends ConditionalFileFilterAbstractTestCase {
    
    private static final String DEFAULT_WORKING_PATH = "./AndFileFilterTestCase/";
    private static final String WORKING_PATH_NAME_PROPERTY_KEY = AndFileFilterTestCase.class.getName() + ".workingDirectory";
    
    public static void main(final String[] args) {
      TestRunner.run(suite());
    }
    
    public static TestSuite suite() {
      return new TestSuite(AndFileFilterTestCase.class);
    }
    
    private List testFilters;
    private List testTrueResults;
    private List testFalseResults;
    private List testFileResults;
    private List testFilenameResults;
    
    public AndFileFilterTestCase(final String name) {
      super(name);
    }
    
    public void setUp() throws Exception {
      super.setUp();
      this.setUpTestFilters();
    }
    
    protected IOFileFilter buildFilterUsingAdd(final List filters) {
      AndFileFilter filter = new AndFileFilter();
      for(int i = 0; i < filters.size(); i++) {
        filter.addFileFilter((IOFileFilter) filters.get(i));
      }
      return filter;
    }
    
    protected IOFileFilter buildFilterUsingConstructor(final List filters) {
      return new AndFileFilter(filters);
    }
    
    protected ConditionalFileFilter getConditionalFileFilter() {
      return new AndFileFilter();
    }
    
    protected String getDefaultWorkingPath() {
      return DEFAULT_WORKING_PATH;
    }
    
    protected List getFalseResults() {
      return this.testFalseResults;
    }
    
    protected List getFileResults() {
      return this.testFileResults;
    }
    
    protected List getFilenameResults() {
      return this.testFilenameResults;
    }
    
    protected List getTestFilters() {
      return this.testFilters;
    }
    
    protected List getTrueResults() {
      return this.testTrueResults;
    }
    
    protected String getWorkingPathNamePropertyKey() {
      return WORKING_PATH_NAME_PROPERTY_KEY;
    }
    
    private void setUpTestFilters() {
      // filters
      //tests
      this.testFilters = new ArrayList();
      this.testTrueResults = new ArrayList();
      this.testFalseResults = new ArrayList();
      this.testFileResults = new ArrayList();
      this.testFilenameResults = new ArrayList();
  
      // test 0 - add empty elements
      {
        testFilters.add(0, null);
        testTrueResults.add(0, null);
        testFalseResults.add(0, null);
        testFileResults.add(0, null);
        testFilenameResults.add(0, null);
      }
        
      // test 1 - Test conditional and with all filters returning true
      {
        // test 1 filters
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        // test 1 true results
        boolean[] trueResults = new boolean[] {true, true, true};
        // test 1 false results
        boolean[] falseResults = new boolean[] {false, false, false};
  
        testFilters.add(1, filters);
        testTrueResults.add(1, trueResults);
        testFalseResults.add(1, falseResults);
        testFileResults.add(1, Boolean.TRUE);
        testFilenameResults.add(1, Boolean.TRUE);
      }
  
      // test 2 - Test conditional and with first filter returning false
      {
        // test 2 filters
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 2 true results
        boolean[] trueResults = new boolean[] {false, false, false};
        // test 2 false results
        boolean[] falseResults = new boolean[] {true, false, false};
  
        testFilters.add(2, filters);
        testTrueResults.add(2, trueResults);
        testFalseResults.add(2, falseResults);
        testFileResults.add(2, Boolean.FALSE);
        testFilenameResults.add(2, Boolean.FALSE);
      }
      
      // test 3 - Test conditional and with second filter returning false
      {
        // test 3 filters
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(falseFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 3 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 3 false results
        boolean[] falseResults = new boolean[] {true, false, false};
  
        testFilters.add(3, filters);
        testTrueResults.add(3, trueResults);
        testFalseResults.add(3, falseResults);
        testFileResults.add(3, Boolean.FALSE);
        testFilenameResults.add(3, Boolean.FALSE);
      }
      
      // test 4 - Test conditional and with third filter returning false
      {
        // test 4 filters
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(falseFilters[1]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 4 true results
        boolean[] trueResults = new boolean[] {true, true, false};
        // test 4 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(4, filters);
        testTrueResults.add(4, trueResults);
        testFalseResults.add(4, falseResults);
        testFileResults.add(4, Boolean.FALSE);
        testFilenameResults.add(4, Boolean.FALSE);
      }
  
      // test 5 - Test conditional and with first and third filters returning false
      {
        // test 5 filters
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(trueFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        // test 5 true results
        boolean[] trueResults = new boolean[] {false, false, false};
        // test 5 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(5, filters);
        testTrueResults.add(5, trueResults);
        testFalseResults.add(5, falseResults);
        testFileResults.add(5, Boolean.FALSE);
        testFilenameResults.add(5, Boolean.FALSE);
      }
      
      // test 6 - Test conditional and with second and third filters returning false
      {
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(falseFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[3]);
        // test 6 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 6 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(6, filters);
        testTrueResults.add(6, trueResults);
        testFalseResults.add(6, falseResults);
        testFileResults.add(6, Boolean.FALSE);
        testFilenameResults.add(6, Boolean.FALSE);
      }
      
      // test 7 - Test conditional and with first and second filters returning false
      {
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[3]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        // test 7 true results
        boolean[] trueResults = new boolean[] {false, false, false};
        // test 7 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(7, filters);
        testTrueResults.add(7, trueResults);
        testFalseResults.add(7, falseResults);
        testFileResults.add(7, Boolean.FALSE);
        testFilenameResults.add(7, Boolean.FALSE);
      }
      
      // test 8 - Test conditional and with fourth filters returning false
      {
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[1]);
        // test 8 true results
        boolean[] trueResults = new boolean[] {true, true, true};
        // test 8 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(8, filters);
        testTrueResults.add(8, trueResults);
        testFalseResults.add(8, falseResults);
        testFileResults.add(8, Boolean.FALSE);
        testFilenameResults.add(8, Boolean.FALSE);
      }
  
      // test 9 - Test conditional and with all filters returning false
      {
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 9 true results
        boolean[] trueResults = new boolean[] {false, false, false};
        // test 9 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(9, filters);
        testTrueResults.add(9, trueResults);
        testFalseResults.add(9, falseResults);
        testFileResults.add(9, Boolean.FALSE);
        testFilenameResults.add(9, Boolean.FALSE);
      }
    }
  }
  
  
  
  1.1                  jakarta-commons/io/src/test/org/apache/commons/io/filefilter/ConditionalFileFilterAbstractTestCase.java
  
  Index: ConditionalFileFilterAbstractTestCase.java
  ===================================================================
  /*
   * Copyright 2002-2004 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.
   */
  package org.apache.commons.io.filefilter;
  
  import java.io.File;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  public abstract class ConditionalFileFilterAbstractTestCase
    extends IOFileFilterAbstractTestCase {
      
    private static final String TEST_FILE_NAME_PREFIX = "TestFile";
    private static final String TEST_FILE_TYPE = ".tst";
    
    protected TesterTrueFileFilter[] trueFilters;
    protected TesterFalseFileFilter[] falseFilters;
    
    private File file;
    private File workingPath;
    
    public ConditionalFileFilterAbstractTestCase(final String name) {
      super(name);
    }
    
    public void setUp() throws Exception {
      this.workingPath = this.determineWorkingDirectoryPath(this.getWorkingPathNamePropertyKey(), this.getDefaultWorkingPath());
      this.file = new File(this.workingPath, TEST_FILE_NAME_PREFIX + 1 + TEST_FILE_TYPE);
      this.trueFilters = new TesterTrueFileFilter[4];
      this.falseFilters = new TesterFalseFileFilter[4];
      this.trueFilters[1] = new TesterTrueFileFilter();
      this.trueFilters[2] = new TesterTrueFileFilter();
      this.trueFilters[3] = new TesterTrueFileFilter();
      this.falseFilters[1] = new TesterFalseFileFilter();
      this.falseFilters[2] = new TesterFalseFileFilter();
      this.falseFilters[3] = new TesterFalseFileFilter();
    }
    
    public void testAdd() {
      List filters = new ArrayList();
      ConditionalFileFilter fileFilter = this.getConditionalFileFilter();
      filters.add(new TesterTrueFileFilter());
      filters.add(new TesterTrueFileFilter());
      filters.add(new TesterTrueFileFilter());
      filters.add(new TesterTrueFileFilter());
      for(int i = 0; i < filters.size(); i++) {
        assertEquals("file filters count: ", i, fileFilter.getFileFilters().size());
        fileFilter.addFileFilter((IOFileFilter) filters.get(i));
        assertEquals("file filters count: ", i+1, fileFilter.getFileFilters().size());
      }
      for(Iterator iter = fileFilter.getFileFilters().iterator(); iter.hasNext();) {
        IOFileFilter filter = (IOFileFilter) iter.next();
        assertTrue("found file filter", filters.contains(filter));
      }
      assertEquals("file filters count", filters.size(), fileFilter.getFileFilters().size());
    }
    
    public void testRemove() {
      List filters = new ArrayList();
      ConditionalFileFilter fileFilter = this.getConditionalFileFilter();
      filters.add(new TesterTrueFileFilter());
      filters.add(new TesterTrueFileFilter());
      filters.add(new TesterTrueFileFilter());
      filters.add(new TesterTrueFileFilter());
      for(int i = 0; i < filters.size(); i++) {
        fileFilter.removeFileFilter((IOFileFilter) filters.get(i));
        assertTrue("file filter removed", !fileFilter.getFileFilters().contains((IOFileFilter) filters.get(i)));
      }
      assertEquals("file filters count", 0, fileFilter.getFileFilters().size());
    }
  
    public void testNoFilters() throws Exception {
      ConditionalFileFilter fileFilter = this.getConditionalFileFilter();
      File file = new File(this.workingPath, TEST_FILE_NAME_PREFIX + 1 + TEST_FILE_TYPE);
      assertFileFiltering(1, (IOFileFilter) fileFilter, file, false);
      assertFilenameFiltering(1, (IOFileFilter) fileFilter, file, false);
    }
    
    public void testFilterBuiltUsingConstructor() throws Exception {
      List testFilters = this.getTestFilters();
      List testTrueResults = this.getTrueResults();
      List testFalseResults = this.getFalseResults();
      List testFileResults = this.getFileResults();
      List testFilenameResults = this.getFilenameResults();
      
      for(int i = 1; i < testFilters.size(); i++) {
        List filters = (List) testFilters.get(i);
        boolean[] trueResults = (boolean []) testTrueResults.get(i);
        boolean[] falseResults = (boolean []) testFalseResults.get(i);
        boolean fileResults = ((Boolean) testFileResults.get(i)).booleanValue();
        boolean filenameResults = ((Boolean) testFilenameResults.get(i)).booleanValue();
  
        // Test conditional AND filter created by passing filters to the constructor
        IOFileFilter filter = this.buildFilterUsingConstructor(filters);
        
        // Test as a file filter
        this.resetTrueFilters(this.trueFilters);
        this.resetFalseFilters(this.falseFilters);
        this.assertFileFiltering(i, filter, this.file, fileResults);
        this.assertTrueFiltersInvoked(i, trueFilters, trueResults);
        this.assertFalseFiltersInvoked(i, falseFilters, falseResults);
  
        // Test as a filename filter
        this.resetTrueFilters(this.trueFilters);
        this.resetFalseFilters(this.falseFilters);
        this.assertFilenameFiltering(i, filter, this.file, filenameResults);
        this.assertTrueFiltersInvoked(i, trueFilters, trueResults);
        this.assertFalseFiltersInvoked(i, falseFilters, falseResults);
      }
    }
    
    public void testFilterBuiltUsingAdd() throws Exception {
      List testFilters = this.getTestFilters();
      List testTrueResults = this.getTrueResults();
      List testFalseResults = this.getFalseResults();
      List testFileResults = this.getFileResults();
      List testFilenameResults = this.getFilenameResults();
      
      for(int i = 1; i < testFilters.size(); i++) {
        List filters = (List) testFilters.get(i);
        boolean[] trueResults = (boolean []) testTrueResults.get(i);
        boolean[] falseResults = (boolean []) testFalseResults.get(i);
        boolean fileResults = ((Boolean) testFileResults.get(i)).booleanValue();
        boolean filenameResults = ((Boolean) testFilenameResults.get(i)).booleanValue();
  
        // Test conditional AND filter created by passing filters to the constructor
        IOFileFilter filter = this.buildFilterUsingAdd(filters);
        
        // Test as a file filter
        this.resetTrueFilters(this.trueFilters);
        this.resetFalseFilters(this.falseFilters);
        this.assertFileFiltering(i, filter, this.file, fileResults);
        this.assertTrueFiltersInvoked(i, trueFilters, trueResults);
        this.assertFalseFiltersInvoked(i, falseFilters, falseResults);
  
        // Test as a filename filter
        this.resetTrueFilters(this.trueFilters);
        this.resetFalseFilters(this.falseFilters);
        this.assertFilenameFiltering(i, filter, this.file, filenameResults);
        this.assertTrueFiltersInvoked(i, trueFilters, trueResults);
        this.assertFalseFiltersInvoked(i, falseFilters, falseResults);
      }
    }
  
    protected abstract ConditionalFileFilter getConditionalFileFilter();
    protected abstract IOFileFilter buildFilterUsingAdd(List filters);
    protected abstract IOFileFilter buildFilterUsingConstructor(List filters);
    protected abstract List getTestFilters();
    protected abstract List getTrueResults();
    protected abstract List getFalseResults();
    protected abstract List getFileResults();
    protected abstract List getFilenameResults();
    protected abstract String getWorkingPathNamePropertyKey();
    protected abstract String getDefaultWorkingPath();
  }
  
  
  
  1.1                  jakarta-commons/io/src/test/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
  
  Index: IOFileFilterAbstractTestCase.java
  ===================================================================
  /*
   * Copyright 2002-2004 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.
   */
  package org.apache.commons.io.filefilter;
  
  import java.io.File;
  import junit.framework.TestCase;
  
  public class IOFileFilterAbstractTestCase extends TestCase {
    
    /**
     * Constructs a new instance of
     * <code>IOFileFilterAbstractTestCase</code>.
     */
    public IOFileFilterAbstractTestCase(final String name) {
      super(name);
    }
    
    public boolean assertFileFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected)
    throws Exception {
      assertTrue(
      "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected + " for " + file,
      (filter.accept(file) == expected));
      return true; // return is irrelevant
    }
  
    public boolean assertFilenameFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected)
    throws Exception {
      // Assumes file has parent and is not passed as null
      assertTrue(
      "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not " + expected + " for " + file,
      (filter.accept(file.getParentFile(), file.getName()) == expected));
      return true; // return is irrelevant
    }
  
    public void assertFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected)
    throws Exception {
      // Note. This only tests the (File, String) version if the parent of
      //       the File passed in is not null
      assertTrue(
      "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected + " for " + file,
      (filter.accept(file) == expected));
  
      if (file != null && file.getParentFile() != null) {
        assertTrue(
        "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not " + expected + " for " + file,
        (filter.accept(file.getParentFile(), file.getName()) == expected));
      } 
      else if (file == null) {
        assertTrue(
        "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not " + expected + " for null",
        filter.accept(file) == expected);
      }
    }
  
    public void assertTrueFiltersInvoked(final int testNumber, final TesterTrueFileFilter[] filters, final boolean[] invoked) {
      for(int i = 1; i < filters.length; i++) {
        assertEquals("test " + testNumber + " filter " + i + " invoked", invoked[i-1], filters[i].isInvoked());
      }
    }
    
    public void assertFalseFiltersInvoked(final int testNumber, final TesterFalseFileFilter[] filters, final boolean[] invoked) {
      for(int i = 1; i < filters.length; i++) {
        assertEquals("test " + testNumber + " filter " + i + " invoked", invoked[i-1], filters[i].isInvoked());
      }
    }
    
    public File determineWorkingDirectoryPath(final String key, final String defaultPath) {
      // Look for a system property to specify the working directory
      String workingPathName = System.getProperty(key, defaultPath);
      return new File(workingPathName);
    }
  
    public void resetFalseFilters(TesterFalseFileFilter[] filters) {
      for(int i = 0; i < filters.length; i++) {
        if(filters[i] != null) {
          filters[i].reset();
        }
      }
    }
    
    public void resetTrueFilters(TesterTrueFileFilter[] filters) {
      for(int i = 0; i < filters.length; i++) {
        if(filters[i] != null) {
          filters[i].reset();
        }
      }
    }
    
    class TesterTrueFileFilter extends TrueFileFilter {
  
      private boolean invoked;
      
      public boolean accept(File file) {
        setInvoked(true);
        return super.accept(file);
      }
      
      public boolean accept(File file, String str) {
        setInvoked(true);
        return super.accept(file, str);
      }
      
      public boolean isInvoked() {
        return this.invoked;
      }
  
      public void setInvoked(boolean invoked) {
        this.invoked = invoked;
      }
      
      public void reset() {
        setInvoked(false);
      }
    }
    
    class TesterFalseFileFilter extends FalseFileFilter {
      
      private boolean invoked;
      
      public boolean accept(File file) {
        setInvoked(true);
        return super.accept(file);
      }
      
      public boolean accept(File file, String str) {
        setInvoked(true);
        return super.accept(file, str);
      }
      
      public boolean isInvoked() {
        return this.invoked;
      }
  
      public void setInvoked(boolean invoked) {
        this.invoked = invoked;
      }
      
      public void reset() {
        setInvoked(false);
      }
    }
  }
  
  
  
  1.1                  jakarta-commons/io/src/test/org/apache/commons/io/filefilter/OrFileFilterTestCase.java
  
  Index: OrFileFilterTestCase.java
  ===================================================================
  /*
   * Copyright 2002-2004 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.
   */
  package org.apache.commons.io.filefilter;
  
  import java.util.ArrayList;
  import java.util.List;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  public class OrFileFilterTestCase extends ConditionalFileFilterAbstractTestCase {
    
    private static final String DEFAULT_WORKING_PATH = "./OrFileFilterTestCase/";
    private static final String WORKING_PATH_NAME_PROPERTY_KEY = OrFileFilterTestCase.class.getName() + ".workingDirectory";
    
    public static void main(final String[] args) {
      TestRunner.run(suite());
    }
    
    public static TestSuite suite() {
      return new TestSuite(OrFileFilterTestCase.class);
    }
    
    private List testFilters;
    private List testTrueResults;
    private List testFalseResults;
    private List testFileResults;
    private List testFilenameResults;
    
    public OrFileFilterTestCase(final String name) {
      super(name);
    }
    
    public void setUp() throws Exception {
      super.setUp();
      this.setUpTestFilters();
    }
    
    protected IOFileFilter buildFilterUsingAdd(final List filters) {
      OrFileFilter filter = new OrFileFilter();
      for(int i = 0; i < filters.size(); i++) {
        filter.addFileFilter((IOFileFilter) filters.get(i));
      }
      return filter;
    }
    
    protected IOFileFilter buildFilterUsingConstructor(final List filters) {
      return new OrFileFilter(filters);
    }
    
    protected ConditionalFileFilter getConditionalFileFilter() {
      return new OrFileFilter();
    }
    
    protected String getDefaultWorkingPath() {
      return DEFAULT_WORKING_PATH;
    }
    
    protected List getFalseResults() {
      return this.testFalseResults;
    }
    
    protected List getFileResults() {
      return this.testFileResults;
    }
    
    protected List getFilenameResults() {
      return this.testFilenameResults;
    }
    
    protected List getTestFilters() {
      return this.testFilters;
    }
    
    protected List getTrueResults() {
      return this.testTrueResults;
    }
    
    protected String getWorkingPathNamePropertyKey() {
      return WORKING_PATH_NAME_PROPERTY_KEY;
    }
    
    private void setUpTestFilters() {
      // filters
      //tests
      this.testFilters = new ArrayList();
      this.testTrueResults = new ArrayList();
      this.testFalseResults = new ArrayList();
      this.testFileResults = new ArrayList();
      this.testFilenameResults = new ArrayList();
  
      // test 0 - add empty elements
      {
        testFilters.add(0, null);
        testTrueResults.add(0, null);
        testFalseResults.add(0, null);
        testFileResults.add(0, null);
        testFilenameResults.add(0, null);
      }
        
      // test 1 - Test conditional or with all filters returning true
      {
        // test 1 filters
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        // test 1 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 1 false results
        boolean[] falseResults = new boolean[] {false, false, false};
  
        testFilters.add(1, filters);
        testTrueResults.add(1, trueResults);
        testFalseResults.add(1, falseResults);
        testFileResults.add(1, Boolean.TRUE);
        testFilenameResults.add(1, Boolean.TRUE);
      }
  
      // test 2 - Test conditional or with first filter returning false
      {
        // test 2 filters
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 2 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 2 false results
        boolean[] falseResults = new boolean[] {true, false, false};
  
        testFilters.add(2, filters);
        testTrueResults.add(2, trueResults);
        testFalseResults.add(2, falseResults);
        testFileResults.add(2, Boolean.TRUE);
        testFilenameResults.add(2, Boolean.TRUE);
      }
      
      // test 3 - Test conditional or with second filter returning false
      {
        // test 3 filters
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(falseFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 3 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 3 false results
        boolean[] falseResults = new boolean[] {false, false, false};
  
        testFilters.add(3, filters);
        testTrueResults.add(3, trueResults);
        testFalseResults.add(3, falseResults);
        testFileResults.add(3, Boolean.TRUE);
        testFilenameResults.add(3, Boolean.TRUE);
      }
      
      // test 4 - Test conditional or with third filter returning false
      {
        // test 4 filters
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(falseFilters[1]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 4 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 4 false results
        boolean[] falseResults = new boolean[] {false, false, false};
      
        testFilters.add(4, filters);
        testTrueResults.add(4, trueResults);
        testFalseResults.add(4, falseResults);
        testFileResults.add(4, Boolean.TRUE);
        testFilenameResults.add(4, Boolean.TRUE);
      }
  
      // test 5 - Test conditional or with first and third filters returning false
      {
        // test 5 filters
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(trueFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        // test 5 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 5 false results
        boolean[] falseResults = new boolean[] {true, false, false};
      
        testFilters.add(5, filters);
        testTrueResults.add(5, trueResults);
        testFalseResults.add(5, falseResults);
        testFileResults.add(5, Boolean.TRUE);
        testFilenameResults.add(5, Boolean.TRUE);
      }
      
      // test 6 - Test conditional or with second and third filters returning false
      {
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(falseFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[3]);
        // test 6 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 6 false results
        boolean[] falseResults = new boolean[] {false, false, false};
      
        testFilters.add(6, filters);
        testTrueResults.add(6, trueResults);
        testFalseResults.add(6, falseResults);
        testFileResults.add(6, Boolean.TRUE);
        testFilenameResults.add(6, Boolean.TRUE);
      }
      
      // test 7 - Test conditional or with first and second filters returning false
      {
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(trueFilters[1]);
        filters.add(falseFilters[3]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        // test 7 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 7 false results
        boolean[] falseResults = new boolean[] {true, true, false};
      
        testFilters.add(7, filters);
        testTrueResults.add(7, trueResults);
        testFalseResults.add(7, falseResults);
        testFileResults.add(7, Boolean.TRUE);
        testFilenameResults.add(7, Boolean.TRUE);
      }
      
      // test 8 - Test conditional or with fourth filter returning false
      {
        List filters = new ArrayList();
        filters.add(trueFilters[1]);
        filters.add(trueFilters[2]);
        filters.add(trueFilters[3]);
        filters.add(falseFilters[1]);
        // test 8 true results
        boolean[] trueResults = new boolean[] {true, false, false};
        // test 8 false results
        boolean[] falseResults = new boolean[] {false, false, false};
      
        testFilters.add(8, filters);
        testTrueResults.add(8, trueResults);
        testFalseResults.add(8, falseResults);
        testFileResults.add(8, Boolean.TRUE);
        testFilenameResults.add(8, Boolean.TRUE);
      }
  
      // test 9 - Test conditional or with all filters returning false
      {
        List filters = new ArrayList();
        filters.add(falseFilters[1]);
        filters.add(falseFilters[2]);
        filters.add(falseFilters[3]);
        // test 9 true results
        boolean[] trueResults = new boolean[] {false, false, false};
        // test 9 false results
        boolean[] falseResults = new boolean[] {true, true, true};
      
        testFilters.add(9, filters);
        testTrueResults.add(9, trueResults);
        testFalseResults.add(9, falseResults);
        testFileResults.add(9, Boolean.FALSE);
        testFilenameResults.add(9, Boolean.FALSE);
      }
    }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message