@TestCase({Assertion.JSR286_50})
public class ListenedURLUpdate
{
public ListenedURLUpdate(PortletTestCase seq)
{
seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
URLGenerationListener1.delegate = updater1;
URLGenerationListener2.delegate = updater2;
//
PortletURL actionURL = response.createActionURL();
//
String s = actionURL.toString();
//
assertEquals(null, actionURL.getPortletMode());
assertEquals(null, actionURL.getWindowState());
assertEquals(0, actionURL.getParameterMap().size());
//
return new InvokeGetResponse(s);
}
});
seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
{
assertParameterMap(Collections.singletonMap("foo", new String[]{"fooAction"}), request);
assertEquals(PortletMode.EDIT, request.getPortletMode());
assertEquals(WindowState.MAXIMIZED, request.getWindowState());
}
});
seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
PortletURL renderURL = response.createRenderURL();
//
String s = renderURL.toString();
//
assertEquals(null, renderURL.getPortletMode());
assertEquals(null, renderURL.getWindowState());
assertEquals(0, renderURL.getParameterMap().size());
//
return new InvokeGetResponse(s);
}
});
seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
assertParameterMap(Collections.singletonMap("foo", new String[]{"fooRender"}), request);
assertEquals(PortletMode.VIEW, request.getPortletMode());