Search in sources :

Example 1 with TaskInputsInternal

use of org.gradle.api.internal.TaskInputsInternal in project gradle by gradle.

the class DependencyAutoWireTaskFactoryTest method addsDependencyOnInputFiles.

@Test
public void addsDependencyOnInputFiles() {
    final TaskInternal task = context.mock(TaskInternal.class);
    final TaskInputsInternal taskInputs = context.mock(TaskInputsInternal.class);
    final FileCollection inputFiles = context.mock(FileCollection.class);
    context.checking(new Expectations() {

        {
            one(delegate).createTask(map());
            will(returnValue(task));
            allowing(task).getInputs();
            will(returnValue(taskInputs));
            allowing(taskInputs).getFiles();
            will(returnValue(inputFiles));
            one(task).dependsOn(inputFiles);
        }
    });
    assertThat(factory.createTask(map()), sameInstance(task));
}
Also used : Expectations(org.jmock.Expectations) TaskInternal(org.gradle.api.internal.TaskInternal) TaskInputsInternal(org.gradle.api.internal.TaskInputsInternal) FileCollection(org.gradle.api.file.FileCollection) Test(org.junit.Test)

Aggregations

FileCollection (org.gradle.api.file.FileCollection)1 TaskInputsInternal (org.gradle.api.internal.TaskInputsInternal)1 TaskInternal (org.gradle.api.internal.TaskInternal)1 Expectations (org.jmock.Expectations)1 Test (org.junit.Test)1