geofflane / grails-constraints

Custom constraints plugin for Grails applications
Apache License 2.0
35 stars 11 forks source link

Constraints plug-in causes tests on Controllers that use Commands fail once installed #2

Closed rrullo closed 14 years ago

rrullo commented 14 years ago

I have created a simple grails-app that demonstrates that when the constraints plug-in is installed that my integration test fails and without it, it succeeds. The failure I get is specifically

No signature of method: net.rrullo.tester.UserController$_closure9.doCall() is applicable for argument types: (net.rrullo.tester.UserCommand, net.rrullo.tester.UserCommand) values: [net.rrullo.tester.UserCommand@1c1902d, net.rrullo.tester.UserCommand@6c4fe] Possible solutions: doCall(net.rrullo.tester.UserCommand), call(), call(net.rrullo.tester.UserCommand), call([Ljava.lang.Object;), call(java.lang.Object)

I'm new to publishing to github so I'm not sure if this is the appropriate way to do this or not, but my demo testapp is available at http://dl.dropbox.com/u/6783272/constraints-test.zip.

Thanks! -Bob

geofflane commented 14 years ago

It's something to do with refreshing the controllers plugin that was done. This was originally put in to get command objects to work at all, but it seems to break the integration test which is weird. Maybe a bug was fixed in a later version of Grails?

// HACK: Couldn't get Command objects to work without it, load order didn't seem to help
manager.refreshPlugin('controllers')
geofflane commented 14 years ago

Without that refresh the constraints are not applied to the Command objects. I think if we find the root cause of that (and don't need the refreshPlugin anymore) then we'll solve this problem as well.

geofflane commented 14 years ago

This is fixed in the 0.5 release