Search in sources :

Example 1 with DefaultBuildOperationWorkerRegistry

use of org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry in project gradle by gradle.

the class DefaultTaskGraphExecuterTest method setUp.

@Before
public void setUp() {
    root = TestUtil.create(temporaryFolder).rootProject();
    final InternalTaskExecutionListener taskExecutionListener = context.mock(InternalTaskExecutionListener.class);
    context.checking(new Expectations() {

        {
            one(listenerManager).createAnonymousBroadcaster(TaskExecutionGraphListener.class);
            will(returnValue(new ListenerBroadcast<TaskExecutionGraphListener>(TaskExecutionGraphListener.class)));
            one(listenerManager).createAnonymousBroadcaster(TaskExecutionListener.class);
            will(returnValue(new ListenerBroadcast<TaskExecutionListener>(TaskExecutionListener.class)));
            allowing(cancellationToken).isCancellationRequested();
            one(listenerManager).getBroadcaster(InternalTaskExecutionListener.class);
            will(returnValue(taskExecutionListener));
            ignoring(taskExecutionListener);
        }
    });
    taskExecuter = new DefaultTaskGraphExecuter(listenerManager, new DefaultTaskPlanExecutor(new DefaultBuildOperationWorkerRegistry(1)), Factories.constant(executer), cancellationToken, buildOperationExecutor);
}
Also used : Expectations(org.jmock.Expectations) TaskExecutionGraphListener(org.gradle.api.execution.TaskExecutionGraphListener) InternalTaskExecutionListener(org.gradle.api.execution.internal.InternalTaskExecutionListener) DefaultBuildOperationWorkerRegistry(org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry) InternalTaskExecutionListener(org.gradle.api.execution.internal.InternalTaskExecutionListener) TaskExecutionListener(org.gradle.api.execution.TaskExecutionListener) Before(org.junit.Before)

Aggregations

TaskExecutionGraphListener (org.gradle.api.execution.TaskExecutionGraphListener)1 TaskExecutionListener (org.gradle.api.execution.TaskExecutionListener)1 InternalTaskExecutionListener (org.gradle.api.execution.internal.InternalTaskExecutionListener)1 DefaultBuildOperationWorkerRegistry (org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry)1 Expectations (org.jmock.Expectations)1 Before (org.junit.Before)1