org.jmock.core
Class InvocationMocker

java.lang.Object
  extended by org.jmock.core.InvocationMocker
All Implemented Interfaces:
Invokable, SelfDescribing, StubMatchersCollection, Verifiable

public class InvocationMocker
extends Object
implements Invokable, StubMatchersCollection

Since:
1.0

Nested Class Summary
static interface InvocationMocker.Describer
           
 
Field Summary
static InvocationMocker.Describer DEFAULT_DESCRIBER
           
 
Constructor Summary
InvocationMocker()
           
InvocationMocker(InvocationMocker.Describer describer)
           
 
Method Summary
 void addMatcher(InvocationMatcher matcher)
           
 StringBuffer describeTo(StringBuffer buffer)
          Appends the description of this object to the buffer.
 boolean hasDescription()
           
 Object invoke(Invocation invocation)
           
 boolean matches(Invocation invocation)
           
 void setName(String name)
           
 void setStub(Stub stub)
           
 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
 

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)
Specified by:
matches in interface Invokable

invoke

public Object invoke(Invocation invocation)
              throws Throwable
Specified by:
invoke in interface Invokable
Throws:
Throwable

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

setName

public void setName(String name)
Specified by:
setName in interface StubMatchersCollection

addMatcher

public void addMatcher(InvocationMatcher matcher)
Specified by:
addMatcher in interface StubMatchersCollection

setStub

public void setStub(Stub stub)
Specified by:
setStub in interface StubMatchersCollection

toString

public String toString()
Overrides:
toString in class Object

hasDescription

public boolean hasDescription()
Specified by:
hasDescription in interface Invokable

describeTo

public StringBuffer describeTo(StringBuffer buffer)
Description copied from interface: SelfDescribing
Appends the description of this object to the buffer.

Specified by:
describeTo in interface SelfDescribing
Parameters:
buffer - The buffer that the description is appended to.
Returns:
The buffer passed to the invokedMethod.