Hi all,

I'm having problems trying to test interception pages with WicketTester in Wicket 1.3. For some reason my application homepage is used instead of the one that threw the RestartResponseAtInterceptPageException. I have the same code running fine in the servlet environment, so I think the issue is most likely with WicketTester. Either that, or it's actually due to my erroneous use of it. Here's my test case:

   public void testContinueToOriginalDestination() throws Exception {
       tester.startPage(TargetPage.class);
       tester.assertRenderedPage(InterceptPage.class);
tester.submitForm("form"); tester.assertRenderedPage(TargetPage.class); // This line fails, as the rendered page is actually the application home page.
   }

TargetPage is set to throw a RestartResponseAtInterceptException at first request:

   private boolean firstTime = true;
public TargetPage() {
       if (firstTime) {
           firstTime = false;
throw new RestartResponseAtInterceptPageException(InterceptPage.class);
       }
   }

My intercept page simply has a form with a continueToOriginalDestination() when submit:

   public InterceptPage() {
       add(new Form("form") {
           @Override
           protected void onSubmit() {
               continueToOriginalDestination();
           }

       });
   }

Can anyone help me with this, or have I encountered some bug with the tester? I have test cases that reproduce the issue.

Sincerely,

--

Lauri Piispanen

+358 45 630 2546
Senior Product Architect
Conmio Ltd
http://www.conmio.com


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

Reply via email to