Package org.apache.sling.junit
Interface TestsManager
-
@ProviderType public interface TestsManagerService that gives access to JUnit test classes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearCaches()Clear our internal caches.voidexecuteTests(Collection<String> testNames, Renderer renderer, TestSelector selector)Execute tests and report results using supplied Renderer - does NOT call setup or cleanup on renderer.Class<?>getTestClass(String testName)Instantiate test class for specified testCollection<String>getTestNames(TestSelector selector)Return the names of available testsvoidlistTests(Collection<String> testNames, Renderer renderer)List tests using supplied Renderer - does NOT call setup or cleanup on renderer.
-
-
-
Method Detail
-
getTestNames
Collection<String> getTestNames(TestSelector selector)
Return the names of available tests- Parameters:
selector- if null, returns all available tests.- Returns:
- the name of the tests
-
clearCaches
void clearCaches()
Clear our internal caches. Useful in automated testing, to make sure changes introduced by recent uploads or configuration or bundles changes are taken into account immediately.
-
getTestClass
Class<?> getTestClass(String testName) throws ClassNotFoundException
Instantiate test class for specified test- Parameters:
testName- the test class- Returns:
- an instance of the class
- Throws:
ClassNotFoundException- if a class fortestNamecannot be found
-
listTests
void listTests(Collection<String> testNames, Renderer renderer) throws Exception
List tests using supplied Renderer - does NOT call setup or cleanup on renderer.- Parameters:
testNames- the tests to listrenderer- the renderer to use- Throws:
Exception- if any error occurs
-
executeTests
void executeTests(Collection<String> testNames, Renderer renderer, TestSelector selector) throws Exception
Execute tests and report results using supplied Renderer - does NOT call setup or cleanup on renderer.- Parameters:
testNames- the testsrenderer- the renderer to use for the reportingselector- the selector used to select tests and test methods (it can benull)- Throws:
Exception- if any error occurs
-
-