Currently MockApplication overrides #internalInit() (why not #init()
?!) and setups almost similar inmemory/mock impls like the ones
BaseWicketTester overrides later.
I find it confusing that in my app I have to use #init() {
setXYZProvider(...)} but in tests this provider is overridden silently
by something else.
Using boolean flag for all providers doesn't seem OK to me. Maybe we
can provide BaseWicketTester#newXYZProvider() for all which can be
overridden and if this method returns 'null' then don't override. This
way the user can allow one inmemory impl but ignore another.
On Sun, Jun 5, 2011 at 6:46 PM, Igor Vaynberg <[email protected]> wrote:
> i think the memory/mock things should be there by default because they
> make the tests run faster. if you want to control it make it a boolean
> on the tester itself. putting this kind of logic into application
> class seems a little dirty.
>
> -igor
>
> On Sun, Jun 5, 2011 at 7:36 AM, Martin Grigorov <[email protected]> wrote:
>> Hi,
>>
>> I had some troubles recently to setup custom ISessionStore and
>> IPageManager for some tests.
>> The problem is that BaseWicketTester overrides anything already setup
>> in MyApp#init() with the inmemory/mock impls.
>> I suggest to move all these inmemory/mock impls in
>> MockApplication#init() and all tests that use "new WicketTester()"
>> will use those. All user's tests will have to override UserApp#init()
>> for the tests if they prefer any inmemory/mock impl, otherwise they
>> will use the default impl provided by Wicket (depends on DEPLOYMENT or
>> DEVELOPMENT mode). This way they will be more close to the real
>> environment and can setup inmemory impl *only* if they decide so.
>>
>> The only exception are IPageRendererProvider and IRequestCycleProvider
>> which has to be special for WicketTester.
>>
>> WDYT ?
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com