Examples of Expectations


Examples of org.jmock.Expectations

    @Test
    public void addsUserInitScriptWhenItExists() throws IOException {
        File initScript = tmpDir.file("init.gradle").createFile();

        context.checking(new Expectations() {{
            allowing(initScriptFinderMock).findScripts(gradleMock);
            will(returnValue(new ArrayList()));
        }});

        List<ScriptSource> sourceList = new UserHomeInitScriptFinder(initScriptFinderMock).findScripts(gradleMock);
View Full Code Here

Examples of org.jmock.Expectations

    }

    @Test
    public void broadcastsBeforeProjectEvaluateEventsToClosures() {
        final Closure closure = HelperUtil.TEST_CLOSURE;
        context.checking(new Expectations() {{
            one(listenerManager).addListener(ProjectEvaluationListener.class, "beforeEvaluate", closure);
        }});

        gradle.beforeProject(closure);
    }
View Full Code Here

Examples of org.jmock.Expectations

        assertThat(sourceList.get(0).getResource().getFile(), equalTo(initScript));
    }

    @Test
    public void doesNotAddUserInitScriptWhenItDoesNotExist() throws IOException {
        context.checking(new Expectations() {{
            allowing(initScriptFinderMock).findScripts(gradleMock);
            will(returnValue(new ArrayList()));
        }});

        List<ScriptSource> sourceList = new UserHomeInitScriptFinder(initScriptFinderMock).findScripts(gradleMock);
View Full Code Here

Examples of org.jmock.Expectations

    }

    @Test
    public void broadcastsAfterProjectEvaluateEventsToClosures() {
        final Closure closure = HelperUtil.TEST_CLOSURE;
        context.checking(new Expectations() {{
            one(listenerManager).addListener(ProjectEvaluationListener.class, "afterEvaluate", closure);
        }});

        gradle.afterProject(closure);
    }
View Full Code Here

Examples of org.jmock.Expectations

    private final TaskGraphExecuter taskExecuter = context.mock(TaskGraphExecuter.class);
    private final ProjectInternal project = context.mock(ProjectInternal.class);

    @Before
    public void setup() {
        context.checking(new Expectations(){{
            allowing(gradle).getTaskGraph();
            will(returnValue(taskExecuter));
            allowing(gradle).getDefaultProject();
            will(returnValue(project));
        }});
View Full Code Here

Examples of org.jmock.Expectations

    private void checkNameFilterApplied(DefaultBuildExecuter executer) {
        final BuildExecuter delegate = context.mock(BuildExecuter.class);
        executer.setDelegate(delegate);

        context.checking(new Expectations(){{
            Task task = context.mock(Task.class);
            TaskContainerInternal taskContainer = context.mock(TaskContainerInternal.class);
            allowing(project).getSubprojects();
            will(returnValue(toSet()));
            allowing(project).getTasks();
View Full Code Here

Examples of org.jmock.Expectations

    }

    @Test
    public void broadcastsBuildStartedEventsToClosures() {
        final Closure closure = HelperUtil.TEST_CLOSURE;
        context.checking(new Expectations() {{
            one(listenerManager).addListener(BuildListener.class, "buildStarted", closure);
        }});

        gradle.buildStarted(closure);
    }
View Full Code Here

Examples of org.jmock.Expectations

    }

    @Test
    public void broadcastsSettingsEvaluatedEventsToClosures() {
        final Closure closure = HelperUtil.TEST_CLOSURE;
        context.checking(new Expectations() {{
            one(listenerManager).addListener(BuildListener.class, "settingsEvaluated", closure);
        }});

        gradle.settingsEvaluated(closure);
    }
View Full Code Here

Examples of org.jmock.Expectations

    }

    @Test
    public void broadcastsProjectsLoadedEventsToClosures() {
        final Closure closure = HelperUtil.TEST_CLOSURE;
        context.checking(new Expectations() {{
            one(listenerManager).addListener(BuildListener.class, "projectsLoaded", closure);
        }});

        gradle.projectsLoaded(closure);
    }
View Full Code Here

Examples of org.jmock.Expectations

    }

    @Test
    public void broadcastsProjectsEvaluatedEventsToClosures() {
        final Closure closure = HelperUtil.TEST_CLOSURE;
        context.checking(new Expectations() {{
            one(listenerManager).addListener(BuildListener.class, "projectsEvaluated", closure);
        }});

        gradle.projectsEvaluated(closure);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.