On Wed, 10 Sep 2008, Jan Stette wrote:
> 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?):

Depending on what exactly "overhaul" means (English is not 
my native language), yes it is :)

> 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'm not sure I understand what are you trying to achieve. Do
you have a concrete example?

WicketTester (and unit testing in general) should aim to 
test one behavior of an object in a certain state per test
execution. So the test methods should conceptually be 
something like

    Panel containing selected user
    - is visible
    - displays user data
    - stores changed user data

It sounds suspicious if you do a lot of operations in a single
unit test method. Longer integration / acceptance / functional 
tests are better done with a different kind of tool that is
actually invoking the whole deployed application.

Does this seem to make sense?

> 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.

Do you have an example of when multiple request cycles get
created on a single operation? It sounds strange. Maybe the
request cycle gets created ad hoc (as you mentioned) in some
places without checking first whether there is one in place
already.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to