Package org.jmock

Examples of org.jmock.Sequence


            one(resolver).select("name1", otherProject);
            will(returnValue(tasks(task1)));
            one(resolver).selectAll("name2", project);
            will(returnValue(tasks(task2)));

            Sequence sequence = context.sequence("tasks");

            one(taskExecuter).addTasks(toSet(task1));
            inSequence(sequence);

            one(taskExecuter).addTasks(toSet(task2));
View Full Code Here


            one(resolver).selectAll("name1", project);
            will(returnValue(tasks(task1)));
            one(resolver).selectAll("name2", project);
            will(returnValue(tasks(task2)));

            Sequence sequence = context.sequence("tasks");

            one(task1).setSomeFlag(true);

            one(taskExecuter).addTasks(toSet(task1));
            inSequence(sequence);
View Full Code Here

    public void createsAndExecutesScriptAndNotifiesListener() {
        context.checking(new Expectations() {{
            allowing(state).getExecuted();
            will(returnValue(false));

            Sequence sequence = context.sequence("seq");

            one(listener).beforeEvaluate(project);
            inSequence(sequence);

            one(state).setExecuting(true);
View Full Code Here

        context.checking(new Expectations() {{
            allowing(state).getExecuted();
            will(returnValue(false));

            Sequence sequence = context.sequence("seq");

            one(listener).beforeEvaluate(project);
            inSequence(sequence);

            one(state).setExecuting(true);
View Full Code Here

    @Test
    public void configuresATargetObjectUsingScript() {
        final Object target = new Object();

        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("seq");
            ScriptSource sourceWithImportsMock = context.mock(ScriptSource.class, "imports");
            LoggingManagerInternal loggingManagerMock = context.mock(LoggingManagerInternal.class);

            one(loggingManagerFactoryMock).create();
            will(returnValue(loggingManagerMock));
View Full Code Here

    @Test
    public void configuresAScriptAwareObjectUsingScript() {
        final ScriptAware target = context.mock(ScriptAware.class);

        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("seq");
            ScriptSource sourceWithImportsMock = context.mock(ScriptSource.class, "imports");
            LoggingManagerInternal loggingManagerMock = context.mock(LoggingManagerInternal.class);

            one(loggingManagerFactoryMock).create();
            will(returnValue(loggingManagerMock));
View Full Code Here

    @Test
    public void redirectsStandardOutputAndSetsContextClassLoaderWhenScriptIsRun() {
        ScriptRunner<Script> scriptRunner = factory.create(scriptMock);

        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("seq");

            one(scriptExecutionListenerMock).beforeScript(scriptMock);
            inSequence(sequence);

            one(standardOutputCaptureMock).start();
View Full Code Here

        final RuntimeException failure = new RuntimeException();

        ScriptRunner<Script> scriptRunner = factory.create(scriptMock);

        context.checking(new Expectations() {{
            Sequence sequence = context.sequence("seq");

            one(scriptExecutionListenerMock).beforeScript(scriptMock);
            inSequence(sequence);

            one(standardOutputCaptureMock).start();
View Full Code Here

        final Collector<FileCopyDetails> collectDetails1 = collector();
        final Collector<Object> collectDetails2 = collector();
        final Collector<Object> collectDetails3 = collector();

        context.checking(new Expectations(){{
            Sequence seq = context.sequence("seq");
            one(delegate).visitSpec(spec);
            inSequence(seq);

            allowing(spec).getAllCopyActions();
            will(returnValue(toList(action1, action2)));
View Full Code Here

    public void copyActionCanExcludeFile() {
        final Action<FileCopyDetails> action1 = context.mock(Action.class, "action1");
        final Action<FileCopyDetails> action2 = context.mock(Action.class, "action2");

        context.checking(new Expectations(){{
            Sequence seq = context.sequence("seq");
            one(delegate).visitSpec(spec);
            inSequence(seq);

            allowing(spec).getAllCopyActions();
            will(returnValue(toList(action1, action2)));
View Full Code Here

TOP

Related Classes of org.jmock.Sequence

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.