View Javadoc
1 /* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */ 2 package org.jmock.dynamic; 3 4 import org.jmock.stub.ReturnStub; 5 import org.jmock.stub.StubBuilder; 6 import org.jmock.stub.ThrowStub; 7 import org.jmock.stub.VoidStub; 8 9 public class InvocationMockerBuilder implements StubBuilder, ExpectationBuilder { 10 11 private InvocationMocker mocker; 12 13 public InvocationMockerBuilder(InvocationMocker mocker) { 14 this.mocker = mocker; 15 } 16 17 public ExpectationBuilder isVoid() { 18 mocker.setStub(new VoidStub()); 19 return this; 20 } 21 22 public ExpectationBuilder returns(Object returnValue) { 23 mocker.setStub(new ReturnStub(returnValue)); 24 return this; 25 } 26 27 public ExpectationBuilder willThrow(Throwable throwable) { 28 mocker.setStub(new ThrowStub(throwable)); 29 return this; 30 } 31 }

This page was automatically generated by Maven