|
JUnit-addons version 1.4 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--junitx.util.AbstractSuiteBuilder
|
+--junitx.util.DirectorySuiteBuilder
Extracts the testcases from a directory. Use the TestFilter to specify the pattern of the classes to load.
DirectorySuiteBuilder builder = new DirectorySuiteBuilder();
Test suite = builer.suite("/home/project/myproject/tests");
Returns a suite containing all tests from files starting with "Sample" and
ending with "Test".
/home/project/myproject/tests
DirectorySuiteBuilder builder = new DirectorySuiteBuilder();
builder.setFilter(new TestFilter() {
public boolean include(String classpath) {
return super.include(classpath) &&
SimpleTestFilter.getClassName(classpath).startsWith("Sample");
}
});
Test suite = builder.suite("/home/project/myproject/tests");
| Constructor Summary | |
DirectorySuiteBuilder()
Constructs an empty DirectorySuiteBuilder object. |
|
DirectorySuiteBuilder(TestFilter filter)
Constructs an DirectorySuiteBuilder object with the given filter. |
|
| Method Summary | |
protected java.util.List |
browse(java.io.File directory)
Returns the list of test classes contained in the directory. |
protected boolean |
isTestClass(java.lang.String path)
Returns true if the given path refers a test class. |
protected void |
merge(java.util.List classenames,
junit.framework.TestSuite suite)
Populates the suite with test cases extracted from the classnames list. |
void |
setFilter(TestFilter filter)
Sets the filter defining the test classes to be included. |
junit.framework.Test |
suite(java.io.File directory)
Constructs a TestSuite by extracting all test classes from the given directory. |
junit.framework.Test |
suite(java.lang.String directoryName)
Constructs a TestSuite by extracting all test classes from the directory of the given directoryName. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DirectorySuiteBuilder()
public DirectorySuiteBuilder(TestFilter filter)
| Method Detail |
public junit.framework.Test suite(java.io.File directory)
throws java.lang.Exception
java.lang.Exception
public junit.framework.Test suite(java.lang.String directoryName)
throws java.lang.Exception
java.lang.Exception
protected java.util.List browse(java.io.File directory)
throws java.lang.Exception
java.lang.ExceptionAbstractSuiteBuilder.isTestClass(java.lang.String)public void setFilter(TestFilter filter)
protected boolean isTestClass(java.lang.String path)
protected void merge(java.util.List classenames,
junit.framework.TestSuite suite)
throws java.lang.ClassNotFoundException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
|
JUnit-addons version 1.4 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||