1 19 20 package org.netbeans.modules.junit.output.antutils; 21 22 import java.io.File ; 23 import java.util.ArrayList ; 24 import java.util.Collection ; 25 import java.util.Iterator ; 26 import org.apache.tools.ant.module.spi.TaskStructure; 27 28 32 final class BatchTest { 33 34 35 private final AntProject project; 36 37 38 private Collection <FileSet> fileSets = new ArrayList <FileSet>(); 39 40 42 BatchTest(AntProject project) { 43 this.project = project; 44 } 45 46 48 void handleChildrenAndAttrs(TaskStructure struct) { 49 for (TaskStructure child : struct.getChildren()) { 50 String childName = child.getName(); 51 if (childName.equals("fileset")) { FileSet fs = new FileSet(project); 53 fileSets.add(fs); 54 fs.handleChildrenAndAttrs(child); 55 continue; 56 } 57 } 58 } 59 60 63 int countTestClasses() { 64 int count = 0; 65 for (FileSet fileSet : fileSets) { 66 Collection <File > matchingFiles = FileSetScanner.listFiles(fileSet); 67 for (File file : matchingFiles) { 68 final String name = file.getName(); 69 if (name.endsWith(".java") || name.endsWith(".class")) { count++; 71 } 72 } 73 } 74 return count; 77 } 78 79 } 80 | Popular Tags |