throws Exception
{
if (!pattern.endsWith(".java")){
pattern += ".java";
}
BatchTest batch = junit.createBatchTest();
IClasspathEntry[] entries = javaProject.getResolvedClasspath(true);
for (IClasspathEntry entry : entries){
if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE){
String path = ProjectUtils.getFilePath(
javaProject.getProject(), entry.getPath().toOSString());
FileSet fileset = new FileSet();
fileset.setDir(new File(path));
fileset.setIncludes(pattern);
batch.addFileSet(fileset);
}
}
}