}
private void navigationTest(NavigationalStateComponent component, boolean useQueryStringPortalURL)
throws Exception
{
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpSession session = new MockHttpSession();
HttpServletResponse response = new MockHttpServletResponse();
ServletConfig config = new MockServletConfig();
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");
JetspeedRequestContext context = new JetspeedRequestContext(request, response, config, null );
// create base PortletURL
PortalURL url = component.createURL(context.getRequest(), context.getCharacterEncoding());
context.setPortalURL(url);
PortletWindow window = new PortletWindowImpl("111");
PortletWindow window2 = new PortletWindowImpl("222");
PortletWindow window3 = new PortletWindowImpl("333");
HashMap parameters = new HashMap();
parameters.put("test",new String[]{"one","two","three"});
String portletURL = url.createPortletURL(window,parameters,PortletMode.EDIT,WindowState.MAXIMIZED,true,false);
String navStateParameterName = Jetspeed.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));
}
context = new JetspeedRequestContext(request, response, config, null );
url = component.createURL(context.getRequest(), context.getCharacterEncoding());