Package org.jmock.stub

Examples of org.jmock.stub.VoidStub


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

    public Invokable createVoidStub(String methodName, InvocationMatcher arguments) {
        return new InvocationMocker(methodName, arguments, new VoidStub());
    }
View Full Code Here


    public Invokable createVoidStub(String methodName, InvocationMatcher arguments) {
        return new InvocationMocker(methodName, arguments, new VoidStub());
    }

    public Invokable createVoidExpectation(String methodName, InvocationMatcher arguments) {
        return callOnce(new InvocationMocker(methodName, arguments, new VoidStub()));
    }
View Full Code Here

    }

    public void testMatchesInvocationBeforeCallingStub() throws Throwable {
        MockInvocationMatcher mockInvocationMatcher = new MockInvocationMatcher();

        InvocationMocker mocker = new InvocationMocker(new InvocationMatcher[]{mockInvocationMatcher}, new VoidStub());
        mockInvocationMatcher.invocation.setExpected(exampleInvocation);

        mocker.invoke(exampleInvocation);

        Verifier.verifyObject(mockInvocationMatcher);
View Full Code Here

    }

    public void testDelegatesVerifyToInvocationMatchers() throws Throwable {
        MockInvocationMatcher mockInvocationMatcher = new MockInvocationMatcher();

        InvocationMocker mocker = new InvocationMocker(new InvocationMatcher[]{mockInvocationMatcher}, new VoidStub());
        mockInvocationMatcher.verifyCalls.setExpected(1);

        mocker.verify();

        Verifier.verifyObject(mockInvocationMatcher);
View Full Code Here

    }

    public void testCanAddExtraMatchers() throws Throwable {
        MockInvocationMatcher mockInvocationMatcher = new MockInvocationMatcher();

        InvocationMocker mocker = new InvocationMocker(new InvocationMatcher[0], new VoidStub());
        mockInvocationMatcher.match.setExpected(exampleInvocation);
        mockInvocationMatcher.invocation.setExpected(exampleInvocation);

        mocker.addMatcher(mockInvocationMatcher);
        mocker.matches(exampleInvocation);
View Full Code Here

import org.jmock.stub.VoidStub;

public class InvocationMockerBuilderTest extends TestCase {
    public class MockInvocationMocker extends InvocationMocker {
        public MockInvocationMocker() {
            super(new InvocationMatcher[0], new VoidStub());
        }
View Full Code Here

    public InvocationMockerBuilder(InvocationMocker mocker) {
        this.mocker = mocker;
    }

    public ExpectationBuilder isVoid() {
        mocker.setStub(new VoidStub());
        return this;
    }
View Full Code Here

    public void verify() {
        coreMock.verify();
    }

    public StubBuilder method(String methodName, Object arg1, Object arg2) {
        InvocationMocker mocker = new InvocationMocker(methodName, C.eq(arg1, arg2), new VoidStub());
        coreMock.add(mocker);
        return new InvocationMockerBuilder(mocker);
    }
View Full Code Here

TOP

Related Classes of org.jmock.stub.VoidStub

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.