org.jmock.stub
Class ReturnStub

java.lang.Object
  extended byorg.jmock.stub.CallStub
      extended byorg.jmock.stub.ReturnStub
All Implemented Interfaces:
Stub

public class ReturnStub
extends CallStub
implements Stub


Constructor Summary
ReturnStub(java.lang.Object result)
           
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.Object invoke(Invocation invocation)
          Processes the invocation.
 
Methods inherited from class org.jmock.stub.CallStub
verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReturnStub

public ReturnStub(java.lang.Object result)
Method Detail

invoke

public java.lang.Object invoke(Invocation invocation)
                        throws java.lang.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 method with a void return type.
Throws:
java.lang.Throwable - An exception to be thrown to the caller, if not returning a value. A checked exception thrown from this method must be in the throws list of the invoked method.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Stub


Copyright © 2003 jMock.org. All Rights Reserved.