Re: What is the way to test a behavior?

2012-11-03 Thread Per Newgro
Thanks, works like expected. You right. If i throw another exception (ex. IAE) the assertion on rendered page is working. So checking the last response status seems to be natural. Per - To unsubscribe, e-mail:

Re: What is the way to test a behavior?

2012-11-02 Thread Martin Grigorov
Hi, Additionally you need to : tester.executeBehavior() otherwise WicketTester is not used at all in your test. On Thu, Nov 1, 2012 at 10:49 PM, vineet semwal vineetsemwa...@gmail.com wrote: hi, this is expected behavior, AbortWithHttpErrorCodeException doesn't respond with

Re: What is the way to test a behavior?

2012-11-02 Thread vineet semwal
hi martin, you missed his test abortRenderingOnUsage() tester.executeBehavior() doesn't fit his case, also tester#executeBehavior(AbstractAjaxBehavior behavior) On Fri, Nov 2, 2012 at 1:49 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Additionally you need to : tester.executeBehavior()

What is the way to test a behavior?

2012-11-01 Thread Per Newgro
Hi, i try to unit test a custom behavior. But i was wondering what's the right way to test it. I provide some code to explain my mind mismatch. The behavior shall interrupt the rendering of a component. I would like to answer this with a 404. Calling the behavior method directly results in

Re: What is the way to test a behavior?

2012-11-01 Thread vineet semwal
hi, this is expected behavior, AbortWithHttpErrorCodeException doesn't respond with InternalErrorPage,it merely sets HTTP error code , you can assert that by below code Assert.assertEquals( tester.getLastResponse().getStatus(), HttpServletResponse.SC_NOT_FOUND);