I am using groovy 1.6.3 and have a closure mocking an interface:
Closure failing = {
throw new RuntimeException("for test")
}
MyType instance = failing as MyType
afterwards I call the toString()-method on the object. I see the closure
being executed:
instance.toString()
Here is an snippet from the Exception:
at groovy.lang.Closure.call(Closure.java:279)
at
org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:48)
at
org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:77)
at $Proxy6.toString(Unknown Source)
is that right?
Thank you
Jan
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
I workaround using a map of closures now.
Thanks for your help!
Jan
Roshan Dawrani schrieb: