URLTestpublic class URLTest extends org.apache.struts2.views.jsp.AbstractTagTest Verifies correct operation of parameter merging.
Contributed by: Daniel Uribe |
Methods Summary |
---|
public void | testIncludeAllDuplicateRequestParams()
String body = "";
Map parameterMap = new HashMap();
parameterMap.put("param", new String[] { "1", "2", "3" });
request.setQueryString("param=1¶m=2¶m=3");
request.setScheme("http");
request.setParameterMap(parameterMap);
URL url = new URL(stack, request, response);
url.setIncludeParams(URL.ALL);
url.setIncludeContext(false);
url.setValue("myAction.action");
url.setNamespace("");
url.start(writer);
url.end(writer, body);
assertEquals("myAction.action?param=1¶m=2¶m=3",
writer.toString());
| public void | testIncludeGetDuplicateRequestParams()
String body = "";
Map parameterMap = new HashMap();
parameterMap.put("param", new String[] { "1", "2", "3" });
request.setQueryString("param=1¶m=2¶m=3");
request.setScheme("http");
request.setParameterMap(parameterMap);
URL url = new URL(stack, request, response);
url.setIncludeParams(URL.GET);
url.setIncludeContext(false);
url.setValue("myAction.action");
url.setNamespace("");
url.start(writer);
url.end(writer, body);
assertEquals("myAction.action?param=1¶m=2¶m=3",
writer.toString());
|
|