ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant DirectoryScannerTest.java
Date Tue, 29 Jul 2003 10:38:36 GMT
antoine     2003/07/29 03:38:35

  Modified:    src/testcases/org/apache/tools/ant DirectoryScannerTest.java
  Log:
  adding 3 tests showing how include and exclude patterns together interact
  
  Revision  Changes    Path
  1.23      +44 -0     ant/src/testcases/org/apache/tools/ant/DirectoryScannerTest.java
  
  Index: DirectoryScannerTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/DirectoryScannerTest.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DirectoryScannerTest.java	28 Jul 2003 22:07:47 -0000	1.22
  +++ DirectoryScannerTest.java	29 Jul 2003 10:38:35 -0000	1.23
  @@ -347,6 +347,50 @@
           }
       }
   
  +    public void testExcludeHasPrecedence() {
  +        DirectoryScanner ds = new DirectoryScanner();
  +        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
  +        ds.setIncludes(new String[] {
  +            "alpha/**"
  +        });
  +        ds.setExcludes(new String[] {
  +            "alpha/**"
  +        });
  +        ds.scan();
  +        compareFiles(ds, new String[] {},
  +                     new String[] {});
  +
  +    }
  +    public void testAlternateIncludeExclude() {
  +        DirectoryScanner ds = new DirectoryScanner();
  +        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
  +        ds.setIncludes(new String[] {
  +            "alpha/**",
  +            "alpha/beta/gamma/**"
  +        });
  +        ds.setExcludes(new String[] {
  +            "alpha/beta/**"
  +        });
  +        ds.scan();
  +        compareFiles(ds, new String[] {},
  +                     new String[] {"alpha"});
  +
  +    }
  +    public void testAlternateExcludeInclude() {
  +        DirectoryScanner ds = new DirectoryScanner();
  +        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
  +        ds.setExcludes(new String[] {
  +            "alpha/**",
  +            "alpha/beta/gamma/**"
  +        });
  +        ds.setIncludes(new String[] {
  +            "alpha/beta/**"
  +        });
  +        ds.scan();
  +        compareFiles(ds, new String[] {},
  +                     new String[] {});
  +
  +    }
       /**
        * Test inspired by Bug#1415.
        */
  
  
  

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


Mime
View raw message