//
return new InvokeGetResponse(url.toString());
}
});
seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
{
protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
{
Map<String, String[]> expectedParameters = Collections.singletonMap("resource", new String[]{"resource_value"});
assertParameterMap(expectedParameters, request);
assertParameterMap(expectedParameters, request.getPrivateParameterMap());
assertParameterMap(new HashMap<String, String[]>(), request.getPrivateRenderParameterMap());
assertParameterMap(new HashMap<String, String[]>(), request.getPublicParameterMap());
//
ResourceURL url = response.createResourceURL();
//
url.setParameter("resource", new String[]{"resource_value"});
url.setParameter("resource_form", new String[]{"resource_form_value1"});
//
InvokePostResponse post = new InvokePostResponse(url.toString());
post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
Body.Form form = new Body.Form();
form.addParameter("form", new String[]{"form_value"});
form.addParameter("resource_form", new String[]{"resource_form_value2"});
post.setBody(form);
//
return post;
}
});
seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
{
protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
{
Map<String, String[]> expectedParameters = new HashMap<String, String[]>();
expectedParameters.put("resource", new String[]{"resource_value"});
expectedParameters.put("resource_form", new String[]{"resource_form_value1", "resource_form_value2"});
expectedParameters.put("form", new String[]{"form_value"});
assertParameterMap(expectedParameters, request);
assertParameterMap(expectedParameters, request.getPrivateParameterMap());
assertParameterMap(new HashMap<String, String[]>(), request.getPrivateRenderParameterMap());
assertParameterMap(new HashMap<String, String[]>(), request.getPublicParameterMap());
//
PortletURL renderURL = response.createRenderURL();
renderURL.setParameter("render", "render_value");
renderURL.setParameter("resource_render", "resource_render_value2");
renderURL.setParameter("form_render", "form_render_value2");
renderURL.setParameter("resource_form_render", "resource_form_render_value3");
//
return new InvokeGetResponse(renderURL.toString());
}
});
seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
ResourceURL url = response.createResourceURL();
//
url.setParameter("resource", new String[]{"resource_value"});
url.setParameter("resource_render", new String[]{"resource_render_value1"});
//
return new InvokeGetResponse(url.toString());
}
});
seq.bindAction(4, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
{
protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
{
Map<String, String[]> expectedParameters = new HashMap<String, String[]>();
expectedParameters.put("resource", new String[]{"resource_value"});
expectedParameters.put("resource_render", new String[]{"resource_render_value1","resource_render_value2"});
expectedParameters.put("render", new String[]{"render_value"});
expectedParameters.put("form_render", new String[]{"form_render_value2"});
expectedParameters.put("resource_form_render", new String[]{"resource_form_render_value3"});
Map<String, String[]> expectedPrivateRenderParameters = new HashMap<String, String[]>();
expectedPrivateRenderParameters.put("render", new String[]{"render_value"});
expectedPrivateRenderParameters.put("resource_render", new String[]{"resource_render_value2"});
expectedPrivateRenderParameters.put("form_render", new String[]{"form_render_value2"});
expectedPrivateRenderParameters.put("resource_form_render", new String[]{"resource_form_render_value3"});
assertParameterMap(expectedParameters, request);
assertParameterMap(expectedParameters, request.getPrivateParameterMap());
assertParameterMap(expectedPrivateRenderParameters, request.getPrivateRenderParameterMap());
assertParameterMap(new HashMap<String, String[]>(), request.getPublicParameterMap());
//
ResourceURL url = response.createResourceURL();
//
url.setParameter("resource", new String[]{"resource_value"});
url.setParameter("resource_form", new String[]{"resource_form_value1"});
url.setParameter("resource_render", new String[]{"resource_render_value1"});
url.setParameter("resource_form_render", new String[]{"resource_form_render_value1"});
//
InvokePostResponse post = new InvokePostResponse(url.toString());
post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
Body.Form form = new Body.Form();
form.addParameter("form", new String[]{"form_value"});
form.addParameter("resource_form", new String[]{"resource_form_value2"});
form.addParameter("form_render", new String[]{"form_render_value1"});
form.addParameter("resource_form_render", new String[]{"resource_form_render_value2"});
post.setBody(form);
//
return post;
}
});
seq.bindAction(5, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
{
protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
{
Map<String, String[]> expectedParameters = new HashMap<String, String[]>();
expectedParameters.put("resource", new String[]{"resource_value"});
expectedParameters.put("resource_form", new String[]{"resource_form_value1","resource_form_value2"});
expectedParameters.put("resource_render", new String[]{"resource_render_value1","resource_render_value2"});
expectedParameters.put("resource_form_render", new String[]{"resource_form_render_value1","resource_form_render_value2","resource_form_render_value3"});
expectedParameters.put("form", new String[]{"form_value"});
expectedParameters.put("form_render", new String[]{"form_render_value1","form_render_value2"});
expectedParameters.put("render", new String[]{"render_value"});
Map<String, String[]> expectedPrivateRenderParameters = new HashMap<String, String[]>();
expectedPrivateRenderParameters.put("render", new String[]{"render_value"});
expectedPrivateRenderParameters.put("resource_render", new String[]{"resource_render_value2"});
expectedPrivateRenderParameters.put("form_render", new String[]{"form_render_value2"});
expectedPrivateRenderParameters.put("resource_form_render", new String[]{"resource_form_render_value3"});
assertParameterMap(expectedParameters, request);
assertParameterMap(expectedParameters, request.getPrivateParameterMap());
assertParameterMap(expectedPrivateRenderParameters, request.getPrivateRenderParameterMap());
assertParameterMap(new HashMap<String, String[]>(), request.getPublicParameterMap());
//
PortletURL renderURL = response.createRenderURL();
renderURL.setParameter("render", "render_value");
renderURL.setParameter("resource_render", "resource_render_value2");
renderURL.setParameter("form_render", "form_render_value2");
renderURL.setParameter("resource_form_render", "resource_form_render_value3");
renderURL.setParameter("public", "public_value");
renderURL.setParameter("resource_public", "resource_public_value2");
renderURL.setParameter("form_public", "form_public_value2");
renderURL.setParameter("resource_form_public", "resource_form_public_value3");
//
return new InvokeGetResponse(renderURL.toString());
}
});
seq.bindAction(6, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
//
ResourceURL url = response.createResourceURL();
//
url.setParameter("resource", new String[]{"resource_value"});
url.setParameter("resource_form", new String[]{"resource_form_value1"});
url.setParameter("resource_render", new String[]{"resource_render_value1"});
url.setParameter("resource_form_render", new String[]{"resource_form_render_value1"});
url.setParameter("resource_public", new String[]{"resource_public_value1"});
url.setParameter("resource_form_public", new String[]{"resource_form_public_value1"});
//
InvokePostResponse post = new InvokePostResponse(url.toString());
post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
Body.Form form = new Body.Form();
form.addParameter("form", new String[]{"form_value"});
form.addParameter("resource_form", new String[]{"resource_form_value2"});
form.addParameter("form_render", new String[]{"form_render_value1"});
form.addParameter("resource_form_render", new String[]{"resource_form_render_value2"});
form.addParameter("form_public", new String[]{"form_public_value1"});
form.addParameter("resource_form_public", new String[]{"resource_form_public_value2"});
post.setBody(form);
//
return post;
}
});
seq.bindAction(7, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
{
protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
{
Map<String, String[]> expectedParameters = new HashMap<String, String[]>();
expectedParameters.put("resource", new String[]{"resource_value"});