{
final File tBasePath = new File("o:/KFM/java/lib");
// Create a new TestSuite with name of this class
// which contains all basic tests in this class (void test*())
final Vector tTestVector = new Vector(); // of Test
DirNavigator tNavigator = new DirNavigator(tBasePath, new FileWorker() {
public void workFile(File aFile) {
if(aFile.getName().endsWith(".class")) {
// ex: .KFM.GUI.MultiPart.class
String tPackage = KFM.Converter.replaceString(File.separator, ".", aFile.getAbsolutePath());
tPackage = tPackage.substring(tBasePath.toString().length() + 1, tPackage.length() - ".class".length());
try {
Class tClass = Class.forName(tPackage);
// only consider junit.framework.TestCase classes or subclasses
if(junit.framework.TestCase.class.isAssignableFrom(tClass)) {
if(CompleteTest.class.equals(tClass)) {
// do not consider Complete Test, otherwise endless recursion
return;
}
Test tTest = getTestSuite(tClass, tPackage);
if(tTest != null) {
tTestVector.add(tTest);
}
}
} catch(ClassNotFoundException e) {
// ignore classes which cannot be loaded, we can't test them either
}
}
}
});
tNavigator.traverse();
TestSuite tTestSuite = new TestSuite("CompleteTest");
for(Iterator tIterator = tTestVector.iterator(); tIterator.hasNext(); ) {
Test tTest = (Test) tIterator.next();
if(tTest instanceof TestSuite) {