Tim,

And how are you overriding the "goToPageB" method in the test?  Using
WicketTester you never actually create an instance of PageB, that is you as
the developer.

-Craig


Timo Rantalaiho wrote:
> 
> On Tue, 17 Jul 2007, Ingram Chen wrote:
> 
>> We also suffer the same issues here. But due to unmanaged nature of
>> Wicket,
>> there is no chance to intercept construction of page B unless you build
>> your
>> own factory for page.
>> 
>> class Page A {
>>     MyFactory myFactory ;
>>     public Page A {
>>        add(new Link("toBPage") {
>>             setResponsePage(myFactory.newBPage());
>>        });
>>     }
>> }
> 
> I might do
> 
>   class PageA extends Page {
>       public PageA() {
>           add(new Link("toBPage") {
>             @Override
>             public void onLinkClicked() {
>                 goToPageB();
>               }
>         );
>       }
> 
>       protected goToPageB() {
>       ...
> 
> and overriding goToPageB() in the test. 
> 
> This technique has even a fancy name in the excellent
> _Working Effectively with Legacy Code_ by Michael Feathers, 
> so maybe it's a kludge to use it in non-legacy code. But 
> it's simple and it works.
> 
> - Timo
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/WicketTester-and-mocking-up-next-page-rendered.-tf4093923.html#a11715824
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to