org.jmock
Class Mock

java.lang.Object
  extended by org.jmock.Mock
All Implemented Interfaces:
BuilderNamespace, DynamicMock, Verifiable

public class Mock
extends Object
implements DynamicMock, BuilderNamespace

Since:
1.0

Constructor Summary
Mock(Class mockedType)
           
Mock(Class mockedType, String name)
           
Mock(DynamicMock coreMock)
           
 
Method Summary
 void addInvokable(Invokable invokable)
           
 NameMatchBuilder expects(InvocationMatcher expectation)
           
 Class getMockedType()
           
 MatchBuilder lookupID(String id)
           
 Object proxy()
           
 void registerMethodName(String id, MatchBuilder builder)
           
 void registerUniqueID(String id, MatchBuilder builder)
           
 void reset()
           
 void setDefaultStub(Stub newDefaultStub)
           
 NameMatchBuilder stubs()
           
 String toString()
           
 void verify()
          Throw an AssertionFailedException if any expectations have not been met.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mock

public Mock(Class mockedType)

Mock

public Mock(Class mockedType,
            String name)

Mock

public Mock(DynamicMock coreMock)
Method Detail

getMockedType

public Class getMockedType()
Specified by:
getMockedType in interface DynamicMock

proxy

public Object proxy()
Specified by:
proxy in interface DynamicMock

toString

public String toString()
Overrides:
toString in class Object

verify

public void verify()
Description copied from interface: Verifiable
Throw an AssertionFailedException if any expectations have not been met.

Specified by:
verify in interface Verifiable

addInvokable

public void addInvokable(Invokable invokable)
Specified by:
addInvokable in interface DynamicMock

stubs

public NameMatchBuilder stubs()

expects

public NameMatchBuilder expects(InvocationMatcher expectation)

setDefaultStub

public void setDefaultStub(Stub newDefaultStub)
Specified by:
setDefaultStub in interface DynamicMock

reset

public void reset()
Specified by:
reset in interface DynamicMock

lookupID

public MatchBuilder lookupID(String id)
Specified by:
lookupID in interface BuilderNamespace

registerUniqueID

public void registerUniqueID(String id,
                             MatchBuilder builder)
Specified by:
registerUniqueID in interface BuilderNamespace

registerMethodName

public void registerMethodName(String id,
                               MatchBuilder builder)
Specified by:
registerMethodName in interface BuilderNamespace