Interface TestLauncher

    • Method Detail

      • withTests

        TestLauncher withTests​(TestOperationDescriptor... descriptors)
        Adds tests to be executed by passing test descriptors received from a previous Gradle Run.
        Parameters:
        descriptors - The OperationDescriptor defining one or more tests.
        Returns:
        this
        Since:
        2.6
      • withTests

        TestLauncher withTests​(Iterable<? extends TestOperationDescriptor> descriptors)
        Adds tests to be executed by passing test descriptors received from a previous Gradle Run.
        Parameters:
        descriptors - The OperationDescriptor defining one or more tests.
        Returns:
        this
        Since:
        2.6
      • withJvmTestClasses

        TestLauncher withJvmTestClasses​(String... testClasses)
        Adds tests to be executed declared by class name.
        Parameters:
        testClasses - The class names of the tests to be executed.
        Returns:
        this
        Since:
        2.6
      • withJvmTestClasses

        TestLauncher withJvmTestClasses​(Iterable<String> testClasses)
        Adds tests to be executed declared by class name.
        Parameters:
        testClasses - The class names of the tests to be executed.
        Returns:
        this
        Since:
        2.6
      • withJvmTestMethods

        TestLauncher withJvmTestMethods​(String testClass,
                                        String... methods)
        Adds tests to be executed declared by class and method name.
        Parameters:
        testClass - The name of the class containing the methods to execute.
        methods - The names of the test methods to be executed.
        Returns:
        this
        Since:
        2.7
      • withJvmTestMethods

        TestLauncher withJvmTestMethods​(String testClass,
                                        Iterable<String> methods)
        Adds tests to be executed declared by class and methods name.
        Parameters:
        testClass - The name of the class containing the methods to execute.
        methods - The names of the test methods to be executed.
        Returns:
        this
        Since:
        2.7
      • run

        void run​(ResultHandler<? super Void> handler)
        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(GradleConnectionException) method is called with the appropriate exception. See run() for a description of the various exceptions that the operation may fail with.

        Parameters:
        handler - The handler to supply the result to.
        Throws:
        IllegalStateException - When the connection has been closed or is closing.
        Since:
        2.6