Package org.jmock.core
Class InvocationMocker
- java.lang.Object
-
- org.jmock.core.InvocationMocker
-
- All Implemented Interfaces:
Invokable,SelfDescribing,StubMatchersCollection,Verifiable
public class InvocationMocker extends java.lang.Object implements Invokable, StubMatchersCollection
- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInvocationMocker.Describer
-
Field Summary
Fields Modifier and Type Field Description static InvocationMocker.DescriberDEFAULT_DESCRIBER
-
Constructor Summary
Constructors Constructor Description InvocationMocker()InvocationMocker(InvocationMocker.Describer describer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMatcher(InvocationMatcher matcher)java.lang.StringBufferdescribeTo(java.lang.StringBuffer buffer)Appends the description of this object to the buffer.booleanhasDescription()java.lang.Objectinvoke(Invocation invocation)booleanmatches(Invocation invocation)voidsetName(java.lang.String name)voidsetStub(Stub stub)java.lang.StringtoString()voidverify()Throw an AssertionFailedException if any expectations have not been met.
-
-
-
Field Detail
-
DEFAULT_DESCRIBER
public static final InvocationMocker.Describer DEFAULT_DESCRIBER
-
-
Constructor Detail
-
InvocationMocker
public InvocationMocker()
-
InvocationMocker
public InvocationMocker(InvocationMocker.Describer describer)
-
-
Method Detail
-
matches
public boolean matches(Invocation invocation)
-
invoke
public java.lang.Object invoke(Invocation invocation) throws java.lang.Throwable
-
verify
public void verify()
Description copied from interface:VerifiableThrow 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:
verifyin interfaceVerifiable
-
setName
public void setName(java.lang.String name)
- Specified by:
setNamein interfaceStubMatchersCollection
-
addMatcher
public void addMatcher(InvocationMatcher matcher)
- Specified by:
addMatcherin interfaceStubMatchersCollection
-
setStub
public void setStub(Stub stub)
- Specified by:
setStubin interfaceStubMatchersCollection
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hasDescription
public boolean hasDescription()
- Specified by:
hasDescriptionin interfaceInvokable
-
describeTo
public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)
Description copied from interface:SelfDescribingAppends the description of this object to the buffer.- Specified by:
describeToin interfaceSelfDescribing- Parameters:
buffer- The buffer that the description is appended to.- Returns:
- The buffer passed to the invokedMethod.
-
-