Package org.jmock.core.stub
Class ThrowStub
- java.lang.Object
-
- junit.framework.Assert
-
- org.jmock.core.stub.ThrowStub
-
- All Implemented Interfaces:
SelfDescribing,Stub
public class ThrowStub extends junit.framework.Assert implements Stub
-
-
Constructor Summary
Constructors Constructor Description ThrowStub(java.lang.Throwable throwable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBufferdescribeTo(java.lang.StringBuffer buffer)Appends the description of this object to the buffer.java.lang.Objectinvoke(Invocation invocation)Processes the invocation.-
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
-
-
-
-
Method Detail
-
invoke
public java.lang.Object invoke(Invocation invocation) throws java.lang.Throwable
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:
java.lang.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.
-
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.
-
-