PortletURL url = response.createActionURL();
return new InvokeGetResponse(url.toString());
}
});
seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletModeException, IOException
{
response.setPortletMode(PortletMode.VIEW);
try
{
response.sendRedirect(request.getContextPath());
fail();
}
catch (IllegalStateException e)
{
//expected
}
}
});
seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
{
PortletURL url = response.createActionURL();
return new InvokeGetResponse(url.toString());
}
});
seq.bindAction(2, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException, WindowStateException
{
response.setWindowState(WindowState.NORMAL);
try
{
response.sendRedirect(request.getContextPath());
fail();
}
catch (IllegalStateException e)
{
//expected
}
}
});
seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
{
PortletURL url = response.createActionURL();
return new InvokeGetResponse(url.toString());
}
});
seq.bindAction(3, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
{
response.setRenderParameter("key", "value");
try
{
response.sendRedirect(request.getContextPath());
fail();
}
catch (IllegalStateException e)
{
//expected
}
}
});
seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
{
PortletURL url = response.createActionURL();
return new InvokeGetResponse(url.toString());
}
});
seq.bindAction(4, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
{
Map map = new HashMap();
map.put("key", new String[]{"value"});