|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.lang.Closure
griffon.test.AbstractClosureProxy
griffon.test.MockClosureProxy
public class MockClosureProxy extends AbstractClosureProxy
This closure proxy stores an expectation and checks it before each call to the target closure. It is used by the Griffon mocking framework.
Field Summary | |
---|---|
Object |
expectation
|
String |
methodName
|
Fields inherited from class AbstractClosureProxy | |
---|---|
target |
Fields inherited from class Closure | |
---|---|
OWNER_FIRST, DELEGATE_FIRST, OWNER_ONLY, DELEGATE_ONLY, TO_SELF, DONE, SKIP, IDENTITY |
Constructor Summary | |
MockClosureProxy(Closure target, String methodName, Object expectation)
Constructor. |
Method Summary | |
---|---|
protected Closure
|
createWrapper(Closure c)
Creates a new |
protected void
|
doAfterCall(Object[] args)
Empty implementation. |
protected void
|
doBeforeCall(Object[] args)
Checks whether the target "method" is expected or not, on the
basis that this closure is mocking a method with the name
|
Methods inherited from class AbstractClosureProxy | |
---|---|
asWritable, call, createWrapper, curry, doAfterCall, doBeforeCall, equals, getDelegate, getDirective, getMaximumNumberOfParameters, getParameterTypes, getProperty, getResolveStrategy, hashCode, isCase, setDelegate, setDirective, setProperty, setResolveStrategy |
Methods inherited from class Closure | |
---|---|
run, setProperty, getProperty, clone, getParameterTypes, setDelegate, getOwner, leftShift, leftShift, rightShift, call, call, call, getDelegate, getMaximumNumberOfParameters, setResolveStrategy, getResolveStrategy, getThisObject, getDirective, setDirective, isCase, asWritable, curry, rcurry, rcurry, ncurry, ncurry, memoize, memoizeAtMost, memoizeAtLeast, memoizeBetween, trampoline, trampoline, getMetaClass, setMetaClass, invokeMethod, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
Object expectation
String methodName
Constructor Detail |
---|
public MockClosureProxy(Closure target, String methodName, Object expectation)
Method Detail |
---|
@Override protected Closure createWrapper(Closure c)
MockClosureProxy
wrapping the given
closure.
c
- The closure to wrap.
@Override protected void doAfterCall(Object[] args)
args
- The arguments to the target closure.
@Override protected void doBeforeCall(Object[] args)
methodName
.
args
- The arguments to the "method" (actually
the argumetns to the target closure invocation).
Groovy Documentation