Package org.jmock.stub

Examples of org.jmock.stub.ThrowStub


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

    public Invokable createThrowableStub(String methodName, InvocationMatcher arguments, Throwable throwable) {
        return new InvocationMocker(methodName, arguments, new ThrowStub(throwable));
    }
View Full Code Here


    public Invokable createThrowableStub(String methodName, InvocationMatcher arguments, Throwable throwable) {
        return new InvocationMocker(methodName, arguments, new ThrowStub(throwable));
    }

    public Invokable createThrowableExpectation(String methodName, InvocationMatcher arguments, Throwable throwable) {
        return callOnce(new InvocationMocker(methodName, arguments, new ThrowStub(throwable)));
    }
View Full Code Here

    public void testThrowStub() {
        final Throwable throwable = new DummyThrowable();

        try {
            new ThrowStub(throwable).invoke(invocation);
        } catch (Throwable t) {
            assertSame("Should be the same throwable", throwable, t);
        }
    }
View Full Code Here

        mocker.setStub(new ReturnStub(returnValue));
        return this;
    }

    public ExpectationBuilder willThrow(Throwable throwable) {
        mocker.setStub(new ThrowStub(throwable));
        return this;
    }
View Full Code Here

TOP

Related Classes of org.jmock.stub.ThrowStub

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.