Package org.jmock.core.stub
Class DefaultResultStub
java.lang.Object
org.jmock.core.stub.DefaultResultStub
- All Implemented Interfaces:
SelfDescribing,Stub
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidcreateErrorMessage(Invocation call) describeTo(StringBuffer buf) Appends the description of this object to the buffer.invoke(Invocation invocation) Processes the invocation.
-
Constructor Details
-
DefaultResultStub
public DefaultResultStub()
-
-
Method Details
-
describeTo
Description copied from interface:SelfDescribingAppends the description of this object to the buffer.- Specified by:
describeToin interfaceSelfDescribing- Parameters:
buf- The buffer that the description is appended to.- Returns:
- The buffer passed to the invokedMethod.
-
addResult
-
invoke
Description copied from interface:StubProcesses the invocation.- Specified by:
invokein interfaceStub- Parameters:
invocation- The invocation to stub.- Returns:
- The result of the invocation, if not throwing an exception.
Must return
nullif 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 thethrowslist of the invoked method.
-
createErrorMessage
-
createDefaultResults
protected void createDefaultResults()
-