ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r424897 - /ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
Date Mon, 24 Jul 2006 04:07:56 GMT
Author: kevj
Date: Sun Jul 23 21:07:55 2006
New Revision: 424897

URL: http://svn.apache.org/viewvc?rev=424897&view=rev
Log:
Use ResourceCollections - integration tested, but not unit tested

Modified:
    ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java

Modified: ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java?rev=424897&r1=424896&r2=424897&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java (original)
+++ ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java Sun Jul 23 21:07:55
2006
@@ -27,13 +27,13 @@
 import org.apache.tools.ant.BuildEvent;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.DirectoryScanner;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.ProjectHelper;
 import org.apache.tools.ant.Target;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.taskdefs.LogOutputStream;
-import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.ResourceCollection;
+import org.apache.tools.ant.types.resources.FileResource;
 
 /**
  * Run all targets in a given build file who's name starts with "test".
@@ -101,8 +101,8 @@
     /**
      * adds build files to run as tests.
      */
-    public void add(FileSet fs) {
-        filesets.add(fs);
+    public void add(ResourceCollection rc) {
+        filesets.add(rc);
     }
 
     /**
@@ -125,7 +125,7 @@
         }
         Iterator iter = filesets.iterator();
         while (iter.hasNext()) {
-            doFileSet((FileSet) iter.next());
+            doFileSet((ResourceCollection) iter.next());
         }
         if (failOnError && (failures > 0 || errors > 0)) {
             throw new BuildException(ERROR_TESTS_FAILED
@@ -138,12 +138,10 @@
     /**
      * Processes a fileset.
      */
-    private void doFileSet(FileSet fs) {
-        DirectoryScanner ds = fs.getDirectoryScanner(getProject());
-        File fromDir = fs.getDir(getProject());
-        String[] files = ds.getIncludedFiles();
-        for (int i = 0; i < files.length; i++) {
-            doFile(new File(fromDir, files[i]));
+    private void doFileSet(ResourceCollection rc) {
+        Iterator i = rc.iterator();
+        while(i.hasNext()) {
+            doFile(((FileResource)i.next()).getFile());
         }
     }
 



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


Mime
View raw message