Package org.apache.sling.junit
Interface TestsManager
@ProviderType
public interface TestsManager
Service that gives access to JUnit test classes
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Caches have been removed.void
executeTests
(@Nullable Collection<String> testNames, @NotNull Renderer renderer, @Nullable TestSelector selector) Deprecated.useexecuteTests(Renderer, TestSelector)
insteadvoid
executeTests
(@NotNull Renderer renderer, @Nullable TestSelector selector) Execute tests and report results using supplied Renderer - does NOT call setup or cleanup on renderer.Class
<?> getTestClass
(@NotNull String testName) Instantiate test class for specified testgetTestNames
(@Nullable TestSelector selector) Return the names of available testsvoid
listTests
(@NotNull Collection<String> testNames, @NotNull Renderer renderer) List tests using supplied Renderer - does NOT call setup or cleanup on renderer.
-
Method Details
-
getTestNames
Return the names of available tests- Parameters:
selector
- if null, returns all available tests.- Returns:
- the name of the tests
-
getTestClass
Instantiate test class for specified test- Parameters:
testName
- the test class- Returns:
- an instance of the class
- Throws:
ClassNotFoundException
- if a class fortestName
cannot be found
-
listTests
void listTests(@NotNull @NotNull Collection<String> testNames, @NotNull @NotNull 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(@NotNull @NotNull Renderer renderer, @Nullable @Nullable TestSelector selector) throws TestsManager.NoTestCasesFoundException, Exception Execute tests and report results using supplied Renderer - does NOT call setup or cleanup on renderer.- Parameters:
renderer
- the renderer to use for the reportingselector
- the selector used to select tests and test methods; all tests are executed if this is null- Throws:
TestsManager.NoTestCasesFoundException
- if no tests matching the selector are availableException
- if an error occurs
-
executeTests
@Deprecated void executeTests(@Nullable @Nullable Collection<String> testNames, @NotNull @NotNull Renderer renderer, @Nullable @Nullable TestSelector selector) throws Exception Deprecated.useexecuteTests(Renderer, TestSelector)
insteadExecute 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
-
clearCaches
Deprecated.Caches have been removed.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.
-