org.jmock
Class Mock
java.lang.Object
org.jmock.Mock
- All Implemented Interfaces:
- BuilderNamespace, DynamicMock, Verifiable
public class Mock
- extends java.lang.Object
- implements DynamicMock, BuilderNamespace
- Since:
- 1.0
Constructor Summary |
Mock(java.lang.Class mockedType)
|
Mock(java.lang.Class mockedType,
java.lang.String name)
|
Mock(DynamicMock coreMock)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Mock
public Mock(java.lang.Class mockedType)
Mock
public Mock(java.lang.Class mockedType,
java.lang.String name)
Mock
public Mock(DynamicMock coreMock)
getMockedType
public java.lang.Class getMockedType()
- Specified by:
getMockedType
in interface DynamicMock
proxy
public java.lang.Object proxy()
- Specified by:
proxy
in interface DynamicMock
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
verify
public void verify()
- Description copied from interface:
Verifiable
- Throw an AssertionFailedException if any expectations have not been met.
Implementations of this method must be idempotent: jMock can call this method
more than once when verifying expectations at the end of a test.
- 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(java.lang.String id)
- Specified by:
lookupID
in interface BuilderNamespace
registerUniqueID
public void registerUniqueID(java.lang.String id,
MatchBuilder builder)
- Specified by:
registerUniqueID
in interface BuilderNamespace
registerMethodName
public void registerMethodName(java.lang.String id,
MatchBuilder builder)
- Specified by:
registerMethodName
in interface BuilderNamespace