KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > junit > runner > SimpleTestCollector


1 package junit.runner;
2
3 /**
4  * An implementation of a TestCollector that considers
5  * a class to be a test class when it contains the
6  * pattern "Test" in its name
7  * @see TestCollector
8  */

9 public class SimpleTestCollector extends ClassPathTestCollector {
10     
11     public SimpleTestCollector() {
12     }
13     
14     protected boolean isTestClass(String JavaDoc classFileName) {
15         return
16             classFileName.endsWith(".class") &&
17             classFileName.indexOf('$') < 0 &&
18             classFileName.indexOf("Test") > 0;
19     }
20 }
21
Popular Tags