Author: julien(a)jboss.com
Date: 2008-01-22 16:44:40 -0500 (Tue, 22 Jan 2008)
New Revision: 9571
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletrequests/RemovePublicRenderParameterOnStateAwareResponseTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestAction.java
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletrequests-war/WEB-INF/portlet.xml
Log:
added test case for PortletURL.removePublicRenderParameter(String name) method
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletrequests/RemovePublicRenderParameterOnStateAwareResponseTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletrequests/RemovePublicRenderParameterOnStateAwareResponseTestCase.java 2008-01-22
21:16:42 UTC (rev 9570)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletrequests/RemovePublicRenderParameterOnStateAwareResponseTestCase.java 2008-01-22
21:44:40 UTC (rev 9571)
@@ -88,7 +88,7 @@
protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
assertParameterMap(new HashMap<String, String[]>(), request);
- assertEquals(Collections.emptyMap(), request.getPublicParameterMap());
+ assertParameterMap(new HashMap<String, String[]>(),
request.getPublicParameterMap());
PortletURL url = response.createRenderURL();
url.setParameter("foo", new
String[]{"foo_value1","foo_value2"});
return new InvokeGetResponse(url.toString());
@@ -121,7 +121,7 @@
protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
assertParameterMap(new HashMap<String, String[]>(), request);
- assertEquals(Collections.emptyMap(), request.getPublicParameterMap());
+ assertParameterMap(new HashMap<String, String[]>(),
request.getPublicParameterMap());
return new EndTestResponse();
}
});
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestAction.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestAction.java 2008-01-22
21:16:42 UTC (rev 9570)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestAction.java 2008-01-22
21:44:40 UTC (rev 9571)
@@ -82,6 +82,18 @@
//
Map<String, String[]> map = request.getParameterMap();
+ assertParameterMap(expectedMap, map);
+ }
+
+ /**
+ * Check that the two parameter maps are equals.
+ *
+ * @param expectedMap the expected map
+ * @param map the actual map
+ * @throws AssertionError if the provided map is not equals to the expected map
+ */
+ public final void assertParameterMap(Map<String, String[]> expectedMap,
Map<String, String[]> map) throws AssertionError
+ {
assertNotNull(map);
assertEquals(expectedMap.size(), map.size());
for (Map.Entry<String, String[]> entry : expectedMap.entrySet())
Modified:
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletrequests-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletrequests-war/WEB-INF/portlet.xml 2008-01-22
21:16:42 UTC (rev 9570)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletrequests-war/WEB-INF/portlet.xml 2008-01-22
21:44:40 UTC (rev 9571)
@@ -42,6 +42,24 @@
<supported-public-render-parameter>foo</supported-public-render-parameter>
</portlet>
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+
<supported-public-render-parameter>foo</supported-public-render-parameter>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+
<supported-public-render-parameter>foo</supported-public-render-parameter>
+ </portlet>
+
<event-definition>
<name>Event</name>
</event-definition>
Show replies by date