|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.hammingweight.hammock.ATestDoubleHandler
com.hammingweight.hammock.Hammock
public class Hammock
The Hammock class is an IInvocationHandler that
causes a test double associated with the handler to behave like a mock
object. The class is an example of the composite pattern; it is an
aggregation of MethodHandler instances. A
MethodHandler can respond to only one method; the
Hammock can respond to more than one method. The methods that
this handler must respond to are set via the setExpectation
methods.
| Field Summary |
|---|
| Fields inherited from interface com.hammingweight.hammock.IClassDefinitions |
|---|
BOOLEAN_CLASS, BYTE_CLASS, CHARACTER_CLASS, DOUBLE_CLASS, FLOAT_CLASS, IMOCKOBJECT_CLASS, INTEGER_CLASS, LONG_CLASS, OBJECT_CLASS, SHORT_CLASS, THROWABLE_CLASS |
| Constructor Summary | |
|---|---|
Hammock()
|
|
| Method Summary | |
|---|---|
void |
invoke(MethodInvocation mi)
Called by a test double when a method is invoked. |
boolean |
isVerified()
Checks whether all expectations were met and whether no methods were unexpectedly invoked. |
void |
setStrictOrdering()
Sets that the mock objects associated with this handler are strict mocks and that the methods must be invoked in the order that they were added to the handler. |
void |
verify()
A method that verifies that a handler was invoked by mock objects as expected. |
| Methods inherited from class com.hammingweight.hammock.ATestDoubleHandler |
|---|
getExpectation, getNumberOfExpectations, setExpectation, setExpectation, setExpectation, setExpectation, setStubExpectation, setStubExpectation, setStubExpectation, setStubExpectation |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Hammock()
| Method Detail |
|---|
public void verify()
HammockException - if verification fails.public boolean isVerified()
true if, and only if, all expectations were met and
no methods were unepectedly invoked.public void setStrictOrdering()
public void invoke(MethodInvocation mi)
mi - The method invocation.
HammockException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||