Package org.gradle.api.internal.project

Examples of org.gradle.api.internal.project.ProjectIdentifier


        assertTrue(spec.containsProject(registry(project(dir), project(dir))));
    }

    @Test
    public void selectsSingleProjectWhichHasSpecifiedProjectDir() {
        ProjectIdentifier project = project(dir);
        assertThat(spec.selectProject(registry(project, project(new File("other")))), sameInstance(project));
    }
View Full Code Here


        }
    }

    @Test
    public void selectProjectFailsWhenMultipleProjectsHaveSpecifiedProjectDir() {
        ProjectIdentifier project1 = project(dir);
        ProjectIdentifier project2 = project(dir);
        try {
            spec.selectProject(registry(project1, project2));
            fail();
        } catch (InvalidUserDataException e) {
            assertThat(e.getMessage(), startsWith("Multiple projects in this build have project directory '" + dir + "':"));
View Full Code Here

        }});
        return registry;
    }

    private ProjectIdentifier project(final File projectDir) {
        final ProjectIdentifier projectIdentifier = context.mock(ProjectIdentifier.class, String.valueOf(counter++));
        context.checking(new Expectations(){{
            allowing(projectIdentifier).getProjectDir();
            will(returnValue(projectDir));
        }});
        return projectIdentifier;
View Full Code Here

        assertTrue(spec.containsProject(registry(project(file), project(file))));
    }

    @Test
    public void selectsSingleProjectWhichHasSpecifiedBuildFile() {
        ProjectIdentifier project = project(file);
        assertThat(spec.selectProject(registry(project, project(new File("other")))), sameInstance(project));
    }
View Full Code Here

        }
    }

    @Test
    public void selectProjectFailsWhenMultipleProjectsHaveSpecifiedBuildFile() {
        ProjectIdentifier project1 = project(file);
        ProjectIdentifier project2 = project(file);
        try {
            spec.selectProject(registry(project1, project2));
            fail();
        } catch (InvalidUserDataException e) {
            assertThat(e.getMessage(), startsWith("Multiple projects in this build have build file '" + file + "':"));
View Full Code Here

        }});
        return registry;
    }

    private ProjectIdentifier project(final File buildFile) {
        final ProjectIdentifier projectIdentifier = context.mock(ProjectIdentifier.class, String.valueOf(counter++));
        context.checking(new Expectations(){{
            allowing(projectIdentifier).getBuildFile();
            will(returnValue(buildFile));
        }});
        return projectIdentifier;
View Full Code Here

        assertTrue(spec.containsProject(registry(project(file), project(file))));
    }

    @Test
    public void selectsSingleProjectWhichHasSpecifiedBuildFile() {
        ProjectIdentifier project = project(file);
        assertThat(spec.selectProject(registry(project, project(new File("other")))), sameInstance(project));
    }
View Full Code Here

        }
    }

    @Test
    public void selectProjectFailsWhenMultipleProjectsHaveSpecifiedBuildFile() {
        ProjectIdentifier project1 = project(file);
        ProjectIdentifier project2 = project(file);
        try {
            spec.selectProject(registry(project1, project2));
            fail();
        } catch (InvalidUserDataException e) {
            assertThat(e.getMessage(), startsWith("Multiple projects in this build have build file '" + file + "':"));
View Full Code Here

        }});
        return registry;
    }

    private ProjectIdentifier project(final File buildFile) {
        final ProjectIdentifier projectIdentifier = context.mock(ProjectIdentifier.class, String.valueOf(counter++));
        context.checking(new Expectations(){{
            allowing(projectIdentifier).getBuildFile();
            will(returnValue(buildFile));
        }});
        return projectIdentifier;
View Full Code Here

        assertTrue(spec.containsProject(registry(project(dir), project(dir))));
    }

    @Test
    public void selectsSingleProjectWhichHasSpecifiedProjectDir() {
        ProjectIdentifier project = project(dir);
        assertThat(spec.selectProject(registry(project, project(new File("other")))), sameInstance(project));
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.project.ProjectIdentifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.