Search in sources :

Example 1 with DefaultTestStartedProgressEvent

use of org.gradle.tooling.internal.provider.events.DefaultTestStartedProgressEvent in project gradle by gradle.

the class ClientForwardingTestOperationListener method started.

@Override
public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) {
    Object details = buildOperation.getDetails();
    if (details instanceof ExecuteTaskBuildOperationDetails) {
        Task task = ((ExecuteTaskBuildOperationDetails) details).getTask();
        if (!(task instanceof Test)) {
            return;
        }
        runningTasks.put(buildOperation.getId(), task.getPath());
    } else if (details instanceof ExecuteTestBuildOperationType.Details) {
        ExecuteTestBuildOperationType.Details testOperationDetails = (ExecuteTestBuildOperationType.Details) details;
        TestDescriptorInternal testDescriptor = (TestDescriptorInternal) testOperationDetails.getTestDescriptor();
        eventConsumer.dispatch(new DefaultTestStartedProgressEvent(testOperationDetails.getStartTime(), adapt(testDescriptor)));
    }
}
Also used : Task(org.gradle.api.Task) ExecuteTaskBuildOperationDetails(org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails) ExecuteTaskBuildOperationDetails(org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails) TestDescriptorInternal(org.gradle.api.internal.tasks.testing.TestDescriptorInternal) Test(org.gradle.api.tasks.testing.Test) DefaultTestStartedProgressEvent(org.gradle.tooling.internal.provider.events.DefaultTestStartedProgressEvent) ExecuteTestBuildOperationType(org.gradle.api.internal.tasks.testing.operations.ExecuteTestBuildOperationType)

Aggregations

Task (org.gradle.api.Task)1 ExecuteTaskBuildOperationDetails (org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails)1 TestDescriptorInternal (org.gradle.api.internal.tasks.testing.TestDescriptorInternal)1 ExecuteTestBuildOperationType (org.gradle.api.internal.tasks.testing.operations.ExecuteTestBuildOperationType)1 Test (org.gradle.api.tasks.testing.Test)1 DefaultTestStartedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTestStartedProgressEvent)1