Search in sources :

Example 1 with TestExecutionException

use of org.gradle.tooling.TestExecutionException in project gradle by gradle.

the class DefaultTestLauncher method run.

public void run(final ResultHandler<? super Void> handler) {
    if (operationDescriptors.isEmpty() && internalJvmTestRequests.isEmpty()) {
        throw new TestExecutionException("No test declared for execution.");
    }
    final ConsumerOperationParameters operationParameters = getConsumerOperationParameters();
    final TestExecutionRequest testExecutionRequest = new TestExecutionRequest(operationDescriptors, ImmutableList.copyOf(testClassNames), ImmutableSet.copyOf(internalJvmTestRequests));
    connection.run(new ConsumerAction<Void>() {

        public ConsumerOperationParameters getParameters() {
            return operationParameters;
        }

        public Void run(ConsumerConnection connection) {
            connection.runTests(testExecutionRequest, getParameters());
            return null;
        }
    }, new ResultHandlerAdapter(handler));
}
Also used : TestExecutionException(org.gradle.tooling.TestExecutionException) ConsumerOperationParameters(org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters) ConsumerConnection(org.gradle.tooling.internal.consumer.connection.ConsumerConnection)

Aggregations

TestExecutionException (org.gradle.tooling.TestExecutionException)1 ConsumerConnection (org.gradle.tooling.internal.consumer.connection.ConsumerConnection)1 ConsumerOperationParameters (org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters)1