net.thucydides.junit.finder
Class TestFinder

Package class diagram package TestFinder
java.lang.Object
  extended by net.thucydides.junit.finder.TestFinder
Direct Known Subclasses:
DataDrivenTestFinder, DefaultTestFinder, NormalTestFinder

public abstract class TestFinder
extends Object

The TestFinder class lets you find the Thucydides tests or test methods underneath a given package.

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()


Field Summary
protected  String rootPackage
           
 
Constructor Summary
protected TestFinder(String rootPackage)
          Create a new test finder instance that will look for tests in the packages underneath the given root package.
 
Method Summary
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootPackage

protected final String rootPackage
Constructor Detail

TestFinder

protected TestFinder(String rootPackage)
Create a new test finder instance that will look for tests in the packages underneath the given root package.

Method Detail

thatFinds

public static TestFinderBuilderFactory thatFinds()

getClasses

public abstract List<Class<?>> getClasses()

countTestMethods

public abstract int countTestMethods()

findTestMethods

public TestMethodFinder findTestMethods()

getAllTestClasses

protected List<Class<?>> getAllTestClasses()

getNormalTestClasses

protected Set<Class<?>> getNormalTestClasses()

getDataDrivenTestClasses

protected List<Class<?>> getDataDrivenTestClasses()

sorted

protected List<Class<?>> sorted(List<Class<?>> classes)

getAllTestMethods

public List<Method> getAllTestMethods()


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.