A TestLauncher
allows you to execute tests in a Gradle build.
Type | Name and description |
---|---|
void |
run() Executes the tests, blocking until complete. |
void |
run(ResultHandler<? super Void> handler) Starts executing the tests. |
TestLauncher |
withJvmTestClasses(String... testClasses) Adds tests to be executed declared by class name. |
TestLauncher |
withJvmTestClasses(Iterable<String> testClasses) Adds tests to be executed declared by class name. |
TestLauncher |
withJvmTestMethods(String testClass, String... methods) Adds tests to be executed declared by class and method name. |
TestLauncher |
withJvmTestMethods(String testClass, Iterable<String> methods) Adds tests to be executed declared by class and methods name. |
TestLauncher |
withTests(TestOperationDescriptor... descriptors) Adds tests to be executed by passing test descriptors received from a previous Gradle Run. |
TestLauncher |
withTests(Iterable<? extends TestOperationDescriptor> descriptors) Adds tests to be executed by passing test descriptors received from a previous Gradle Run. |
Methods inherited from class | Name |
---|---|
interface ConfigurableLauncher |
addProgressListener, addProgressListener, addProgressListener, addProgressListener, setColorOutput, setJavaHome, setJvmArguments, setJvmArguments, setStandardError, setStandardInput, setStandardOutput, withArguments, withArguments, withCancellationToken |
interface LongRunningOperation |
addProgressListener, addProgressListener, addProgressListener, addProgressListener, setColorOutput, setJavaHome, setJvmArguments, setJvmArguments, setStandardError, setStandardInput, setStandardOutput, withArguments, withArguments, withCancellationToken |
Executes the tests, blocking until complete.
Starts executing the tests. This method returns immediately, and the result is later passed to the given handler.
If the operation fails, the handler's ResultHandler.onFailure method is called with the appropriate exception. See run() for a description of the various exceptions that the operation may fail with.
handler
- The handler to supply the result to.Adds tests to be executed declared by class name.
testClasses
- The class names of the tests to be executed.Adds tests to be executed declared by class name.
testClasses
- The class names of the tests to be executed.Adds tests to be executed declared by class and method name.
testClass
- The name of the class containing the methods to execute.methods
- The names of the test methods to be executed.Adds tests to be executed declared by class and methods name.
testClass
- The name of the class containing the methods to execute.methods
- The names of the test methods to be executed.Adds tests to be executed by passing test descriptors received from a previous Gradle Run.
descriptors
- The OperationDescriptor defining one or more tests.Adds tests to be executed by passing test descriptors received from a previous Gradle Run.
descriptors
- The OperationDescriptor defining one or more tests.