|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hammingweight.hammock.AMockObject
public abstract class AMockObject
The AMockObject class is extended by mock objects so that they can use the Hammock framework.
Field Summary |
---|
Constructor Summary | |
---|---|
AMockObject()
|
Method Summary | |
---|---|
static void |
assertReturnNotNull(MockMethod method,
java.lang.Object returnValue)
A convenience method that verifies that a value isn't null
and throws a HammockException if it is. |
IInvocationHandler |
getInvocationHandler()
Returns the invocation handler associated with this object. |
void |
setInvocationHandler(IInvocationHandler handler)
Sets the invocation handler associated with this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AMockObject()
Method Detail |
---|
public IInvocationHandler getInvocationHandler()
getInvocationHandler
in interface IMockObject
HammockException
- if no handler has been set.public void setInvocationHandler(IInvocationHandler handler)
setInvocationHandler
in interface IMockObject
handler
- The invocation handler to be used by the mock object.
HammockException
- if a handler has already been set.public static final void assertReturnNotNull(MockMethod method, java.lang.Object returnValue)
null
and throws a HammockException
if it is. This method is
used to check that methods that return a primitive value don't try to
return null
which is valid only as a value for an
Object
reference and not a primitive type.
method
- The method that is checking that a return value is not
null
.returnValue
- the return value to be checked.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |