summaryrefslogtreecommitdiffstats
path: root/test-runner/src/junit/runner/SimpleTestCollector.java
blob: 543168f8092f4e0070d2869f88f0327eb9795ab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package junit.runner;

/**
 * An implementation of a TestCollector that considers
 * a class to be a test class when it contains the
 * pattern "Test" in its name
 * @see TestCollector
 * {@hide} - Not needed for 1.0 SDK
 */
public class SimpleTestCollector extends ClassPathTestCollector {
	
	public SimpleTestCollector() {
	}
	
	protected boolean isTestClass(String classFileName) {
		return 
			classFileName.endsWith(".class") && 
			classFileName.indexOf('$') < 0 &&
			classFileName.indexOf("Test") > 0;
	}
}