junit.runner
Class ClassPathTestCollector

java.lang.Object
  extended by junit.runner.ClassPathTestCollector
All Implemented Interfaces:
TestCollector
Direct Known Subclasses:
LoadingTestCollector, SimpleTestCollector

public abstract class ClassPathTestCollector
extends Object
implements TestCollector

An implementation of a TestCollector that consults the class path. It considers all classes on the class path excluding classes in JARs. It leaves it up to subclasses to decide whether a class is a runnable Test.

See Also:
TestCollector

Field Summary
(package private) static int SUFFIX_LENGTH
           
 
Constructor Summary
ClassPathTestCollector()
           
 
Method Summary
protected  String classNameFromFile(String classFileName)
           
 Hashtable collectFilesInPath(String classPath)
           
(package private)  Hashtable collectFilesInRoots(Vector roots)
           
 Enumeration collectTests()
          Returns an enumeration of Strings with qualified class names
(package private)  void gatherFiles(File classRoot, String classFileName, Hashtable result)
           
protected  boolean isTestClass(String classFileName)
           
(package private)  Vector splitClassPath(String classPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUFFIX_LENGTH

static final int SUFFIX_LENGTH
Constructor Detail

ClassPathTestCollector

public ClassPathTestCollector()
Method Detail

collectTests

public Enumeration collectTests()
Description copied from interface: TestCollector
Returns an enumeration of Strings with qualified class names

Specified by:
collectTests in interface TestCollector

collectFilesInPath

public Hashtable collectFilesInPath(String classPath)

collectFilesInRoots

Hashtable collectFilesInRoots(Vector roots)

gatherFiles

void gatherFiles(File classRoot,
                 String classFileName,
                 Hashtable result)

splitClassPath

Vector splitClassPath(String classPath)

isTestClass

protected boolean isTestClass(String classFileName)

classNameFromFile

protected String classNameFromFile(String classFileName)