Package org.jmock.stub

Examples of org.jmock.stub.ReturnStub


import org.jmock.stub.VoidStub;

public class InvokableFactory {

    public Invokable createReturnStub(String methodName, InvocationMatcher arguments, Object result) {
        return new InvocationMocker(methodName, arguments, new ReturnStub(result));
    }
View Full Code Here


    public Invokable createReturnStub(String methodName, InvocationMatcher arguments, Object result) {
        return new InvocationMocker(methodName, arguments, new ReturnStub(result));
    }

    public Invokable createReturnExpectation(String methodName, InvocationMatcher arguments, Object result) {
        return callOnce(new InvocationMocker(methodName, arguments, new ReturnStub(result)));
    }
View Full Code Here

    Invocation invocation = new Invocation("ignoredName", new Class[0], void.class, new Object[0]);

    public void testReturnStub() throws Throwable {
        final String RESULT = "result";

        assertSame("Should be the same result object", RESULT, new ReturnStub(RESULT).invoke(invocation));
    }
View Full Code Here

        mocker.setStub(new VoidStub());
        return this;
    }

    public ExpectationBuilder returns(Object returnValue) {
        mocker.setStub(new ReturnStub(returnValue));
        return this;
    }
View Full Code Here

TOP

Related Classes of org.jmock.stub.ReturnStub

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.