01: package net.sourceforge.jaxor.tests;
02:
03: import org.apache.tools.ant.types.FileSet;
04: import org.apache.tools.ant.DirectoryScanner;
05: import org.apache.tools.ant.Project;
06:
07: import java.util.List;
08: import java.util.ArrayList;
09: import java.util.Collection;
10: import java.util.Iterator;
11:
12: import net.sourceforge.jaxor.util.FileUtils;
13:
14: /**
15: * Created By: Mike
16: * Date: Jan 22, 2004
17: * Time: 12:01:53 AM
18: *
19: * Last Checkin: $Author: mrettig $
20: * Date: $Date: 2004/01/24 18:07:43 $
21: * Revision: $Revision: 1.1 $
22: */
23: public class TestFileSet {
24:
25: private final List filesets = new ArrayList();
26:
27: public void addConfiguredFileset(FileSet fs) {
28: filesets.add(fs);
29: }
30:
31: public Collection getTests(Project project) {
32: List tests = new ArrayList();
33: for (Iterator iterator = filesets.iterator(); iterator
34: .hasNext();) {
35: FileSet fs = (FileSet) iterator.next();
36: DirectoryScanner ds = fs.getDirectoryScanner(project);
37: String[] srcFiles = ds.getIncludedFiles();
38: for (int j = 0; j < srcFiles.length; j++) {
39: String file = FileUtils.toClassFileName(srcFiles[j]);
40: tests.add(file);
41: }
42: }
43: return tests;
44: }
45: }
|