Hi all,

I've had a few problems with WicketTester recently and would like to submit
a request for when it gets overhauled for version 1.5 (is that still the
plan by the way?):

It would be really useful to have a clean way to hook in code to execute
pre- and post-request for operations that take place through WicketTester.
In other words, some way to intercept all operations.  In a real
application, I can use a ServletFilter or override methods in WicketFilter
to perform per-request initialisation and cleanup, but WicketTester doesn't
execute its operations through these classes.  So it would be very useful to
do something similar when using WicketTester.

I've tried various ways for doing this.  One was to extend the RequestCycle
with code that it calls out to "pre" processing when created and "post"
processing when detached.  I found this didn't work as sometimes
WicketTester will create multiple request cycles whilst performing a single
operation, so I got multiple invocations to the "pre" code.

I also tried overriding WicketTester's MockWebApplication's methods
processRequestCycle(*) but I found there were cases of operations where
these would not be invocated.  For example, BaseWicketTester.clickLink()
will, in case of various Ajax components, create an ad-hoc request cycle and
process this, instead of going through the application.

This is with Wicket 1.3.3 by the way.  If there's some other, better way to
achieve all of this then please correct me and consider the feature request
withdrawn...  :-)

Regards,
Jan

Reply via email to