On Sun, 08 Feb 2009, Erick Fleming wrote:
>         private final org.apache.wicket.markup.repeater.data.IDataProvider
> org.apache.wicket.markup.repeater.data.DataViewBase.dataProvider
> [class=$Proxy5]
>           protected java.lang.reflect.InvocationHandler
> java.lang.reflect.Proxy.h [class=org.jmock.lib.JavaReflectionImposteriser$1]
> <----- field that is not serializable
> 
> I know Wicket likes everything to be serializable so does this mean that
> mocking frameworks are not compatible by default?

Yep, this might be an issue -- we have worked around it by
using HttpSessionStore in unit tests (I think that it is
done by overriding Application.newSessionStore()) in the
tests.

If the mocked dependency is behind a serialisable proxy
(that e.g. wicket-ioc does automatically) it might work
right awat. In your case it would mean mocking only the DAO
or some such dependency of the data provider that takes care
of getting the data.

Your test (well, spec) looks good!

>                 one(accountProvider).iterator(anyInt, anyInt)
>                 one(accountProvider).size
>                 one(accountProvider).detach

Once it's working you migh twant to make accountProvider
return some data, too.

Best wishes,
Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to