test.jmock.core.testsupport
Class MockStub

java.lang.Object
  extended bytest.jmock.core.testsupport.MockStub
All Implemented Interfaces:
SelfDescribing, Stub, Verifiable

public class MockStub
extends Object
implements Stub, Verifiable


Field Summary
 ExpectationValue describeToBuffer
           
 String describeToOutput
           
 ExpectationValue invokeInvocation
           
 Object invokeResult
           
 
Constructor Summary
MockStub()
           
MockStub(String name)
           
 
Method Summary
 StringBuffer describeTo(StringBuffer buffer)
          Appends the description of this object to the buffer.
 Object invoke(Invocation invocation)
          Processes the invocation.
 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

invokeInvocation

public ExpectationValue invokeInvocation

invokeResult

public Object invokeResult

describeToBuffer

public ExpectationValue describeToBuffer

describeToOutput

public String describeToOutput
Constructor Detail

MockStub

public MockStub()

MockStub

public MockStub(String name)
Method Detail

toString

public String toString()

invoke

public Object invoke(Invocation invocation)
              throws Throwable
Description copied from interface: Stub
Processes the invocation.

Specified by:
invoke in interface Stub
Parameters:
invocation - The invocation to stub.
Returns:
The result of the invocation, if not throwing an exception. Must return null if the invocation is of a invokedMethod with a void return type.
Throws:
Throwable - An exception to be thrown to the caller, if not returning a value. A checked exception thrown from this invokedMethod must be in the throws list of the invoked method.

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.

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