You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dirk Forchel <di...@exedio.com> on 2011/10/11 15:07:29 UTC
Custom ServletWebRequest and BaseWicketTester in Wicket 1.5
In our WebApplication we use a customized WebRequest which extends
ServletWebRequest.
@Override
protected WebRequest newWebRequest( final HttpServletRequest servletRequest,
final String filterPath )
{
return new FooServletWebRequest( servletRequest, filterPath );
}
In order to test some pages/components against our WebApplication I would
assume, that the BaseWicketTester takes care of the new created WebRequest,
but he doesn't.
BaseWicketTester:
private void setupNextRequestCycle()
{
request = new MockHttpServletRequest(application, httpSession,
servletContext);
request.setURL(request.getContextPath() + request.getServletPath() + "/");
...
response = new MockHttpServletResponse(request);
ServletWebRequest servletWebRequest = newServletWebRequest();
requestCycle = application.createRequestCycle(servletWebRequest,
newServletWebResponse(servletWebRequest));
...
}
private ServletWebRequest newServletWebRequest()
{
return new ServletWebRequest(request, request.getFilterPrefix());
}
The used WebRequest for the WicketTester is always the ServletWebRequest
class. As far as I know there is no other way to extend and customize the
WebRequest for the WicketTester class.
I would assume. that the BaseWicketTester in the method
setupNextRequestCycle() would use application.createWebRequest(request,
filterPath) to use the overriden WebRequest instance?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Custom-ServletWebRequest-and-BaseWicketTester-in-Wicket-1-5-tp3894285p3894285.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Custom ServletWebRequest and BaseWicketTester in Wicket 1.5
Posted by Martin Grigorov <mg...@apache.org>.
create a ticket with a quickstart
thanks!
On Tue, Oct 11, 2011 at 4:07 PM, Dirk Forchel <di...@exedio.com> wrote:
> In our WebApplication we use a customized WebRequest which extends
> ServletWebRequest.
>
> @Override
> protected WebRequest newWebRequest( final HttpServletRequest servletRequest,
> final String filterPath )
> {
> return new FooServletWebRequest( servletRequest, filterPath );
> }
>
> In order to test some pages/components against our WebApplication I would
> assume, that the BaseWicketTester takes care of the new created WebRequest,
> but he doesn't.
>
> BaseWicketTester:
>
> private void setupNextRequestCycle()
> {
> request = new MockHttpServletRequest(application, httpSession,
> servletContext);
> request.setURL(request.getContextPath() + request.getServletPath() + "/");
> ...
> response = new MockHttpServletResponse(request);
> ServletWebRequest servletWebRequest = newServletWebRequest();
> requestCycle = application.createRequestCycle(servletWebRequest,
> newServletWebResponse(servletWebRequest));
> ...
> }
>
> private ServletWebRequest newServletWebRequest()
> {
> return new ServletWebRequest(request, request.getFilterPrefix());
> }
>
> The used WebRequest for the WicketTester is always the ServletWebRequest
> class. As far as I know there is no other way to extend and customize the
> WebRequest for the WicketTester class.
> I would assume. that the BaseWicketTester in the method
> setupNextRequestCycle() would use application.createWebRequest(request,
> filterPath) to use the overriden WebRequest instance?
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Custom-ServletWebRequest-and-BaseWicketTester-in-Wicket-1-5-tp3894285p3894285.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org