}
protected HttpServletRequest buildRequest(PortalURL portalURL, boolean useQueryStringPortalURL)
{
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpSession session = new MockHttpSession();
request.setSession(session);
request.setServerName("www.sporteportal.com");
request.setScheme("http");
request.setContextPath("/jetspeed");
request.setServletPath("/portal");
request.setPathInfo("stuff");
request.setRequestURI("/jetspeed/portal/stuff");
portalURL.setRequest(request);
portalURL.setCharacterEncoding("UTF-8");
PortletWindow window = new PortletWindowImpl("111");
HashMap parameters = new HashMap();
parameters.put("test",new String[]{"one","two","three"});
String portletURL = portalURL.createPortletURL(window,parameters,PortletMode.EDIT,WindowState.MAXIMIZED,true,false);
String navStateParameterName = engine.getContext().getConfigurationProperty("portalurl.navigationalstate.parameter.name", AbstractPortalURL.DEFAULT_NAV_STATE_PARAMETER);
if ( useQueryStringPortalURL )
{
request.setupAddParameter(navStateParameterName,portletURL.substring(portletURL.indexOf('=')+1));
}
else
{
request.setPathInfo(portletURL.substring(portletURL.indexOf("/portal")+7));
}
return request;
}