//
return new InvokeGetResponse(response.createRenderURL().toString());
}
});
seq.bindAction(0, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
{
public Response execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
{
HttpSession session = request.getSession(false);
assertNull(session);
//
session = request.getSession();
assertNotNull(session);
assertTrue(session.isNew());
session.setAttribute("foo", "foo_dispatched_value");
assertEquals("foo_dispatched_value", session.getAttribute("foo"));
//
return null;
}
});
seq.bindAction(1, portletJoinPoint, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
PortletSession session = request.getPortletSession(false);
assertNotNull(session);
assertFalse(session.isNew());
assertEquals("foo_dispatched_value", session.getAttribute("foo", sessionScope));
//
PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
assertNotNull(dispatcher);
dispatcher.include(request, response);
//
try
{
session.isNew();
fail();
}
catch (IllegalStateException ignore)
{
}
//
return new EndTestResponse();
}
});
seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
{
public Response execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
{
HttpSession session = request.getSession(false);
assertNotNull(session);