public abstract class TestFinder extends Object
You instantiate a TestFinder by providing the top-level package where the tests live.
You can then find the list of Thucydides test classes using getNormalTestClasses(), getDataDrivenTestClasses(), and getAllTestClasses() (which returns both normal and data-driven tests).
You may also need to retrieve the list of test methods for a particular category of class. You can do this using the getTestMethodsFrom() method, e.g.
new TestFinder("my.package").getTestMethodsFrom().normalTestClasses()| Modifier and Type | Field and Description |
|---|---|
protected String |
rootPackage |
| Modifier | Constructor and Description |
|---|---|
protected |
TestFinder(String rootPackage)
Create a new test finder instance that will look for tests in the packages underneath the given root package.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
countTestMethods() |
TestMethodFinder |
findTestMethods() |
protected List<Class<?>> |
getAllTestClasses() |
List<Method> |
getAllTestMethods() |
abstract List<Class<?>> |
getClasses() |
protected List<Class<?>> |
getDataDrivenTestClasses() |
protected Set<Class<?>> |
getNormalTestClasses() |
protected List<Class<?>> |
sorted(List<Class<?>> classes) |
static TestFinderBuilderFactory |
thatFinds() |
protected final String rootPackage
protected TestFinder(String rootPackage)
rootPackage - The root package used as the starting point when looking for test classes.public static TestFinderBuilderFactory thatFinds()
public abstract int countTestMethods()
public TestMethodFinder findTestMethods()
Copyright © 2023. All rights reserved.