Re: Mocking out component.setResponsePage
Awesome. I think that's exactly what I need. Thanks Clint. -Eric On May 29, 2009, at 12:24 PM, Clint Popetz wrote: You can construct a WicketTester with an application subclass...it just creates a default one for you internally if you don't: WicketTester yourTester = new WicketTester(new WicketTester.DummyWebApplication() { public RequestCycle newRequestCycle(final Request request, final Response response) { //... } }); -Clint On Fri, May 29, 2009 at 2:02 PM, Eric Weise wrote: Hi Clint, One thing though is my unit test is not invoking the seam framework and it looks like that class extends the SeamWebApplication. My unit test just uses WicketTester and has a routine to inject mock objects on any @In annotation fields in the component hierarchy.Is there a similar application I can override somewhere in the wickettester? thanks Eric On May 29, 2009, at 11:43 AM, Clint Popetz wrote: Hi Eric :) Override WicketApplication.newRequestCycle() -Clint On Fri, May 29, 2009 at 1:20 PM, Eric Weise wrote: Hi, Does anyone know a way to mock out calls to component.setResponsePage when unit testing? This method causes me to not only mock out dependencies in the page I'm testing, but in the response page as well, which is a pain. I thought that maybe I could extend RequestCycle and override the setResponsePage methods but I don't see how to make wicket use my extended request cycle. Can this be done or is there another way? much thanks Eric - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Clint Popetz http://42lines.net Scalable Web Application Development - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Clint Popetz http://42lines.net Scalable Web Application Development - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Mocking out component.setResponsePage
Hi Clint, One thing though is my unit test is not invoking the seam framework and it looks like that class extends the SeamWebApplication. My unit test just uses WicketTester and has a routine to inject mock objects on any @In annotation fields in the component hierarchy. Is there a similar application I can override somewhere in the wickettester? thanks Eric On May 29, 2009, at 11:43 AM, Clint Popetz wrote: Hi Eric :) Override WicketApplication.newRequestCycle() -Clint On Fri, May 29, 2009 at 1:20 PM, Eric Weise wrote: Hi, Does anyone know a way to mock out calls to component.setResponsePage when unit testing? This method causes me to not only mock out dependencies in the page I'm testing, but in the response page as well, which is a pain. I thought that maybe I could extend RequestCycle and override the setResponsePage methods but I don't see how to make wicket use my extended request cycle. Can this be done or is there another way? much thanks Eric - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Clint Popetz http://42lines.net Scalable Web Application Development - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Mocking out component.setResponsePage
Hi, Does anyone know a way to mock out calls to component.setResponsePage when unit testing? This method causes me to not only mock out dependencies in the page I'm testing, but in the response page as well, which is a pain. I thought that maybe I could extend RequestCycle and override the setResponsePage methods but I don't see how to make wicket use my extended request cycle. Can this be done or is there another way? much thanks Eric - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org