[ 
https://issues.apache.org/jira/browse/PLUTO-670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Neil Griffin updated PLUTO-670:
-------------------------------
    Summary: TCK: Contesting getParameterMap tests that verify an unmodifiable 
Map object  (was: TCK: Contesting 
V2AddlRequestTests_SPEC2_11_Action_parameters6, V2AddlRequestTests_SPEC2_, 
V3HeaderPortletTests_SPEC15_Header_parameters611_Event_parameters6, 
V2AddlRequestTests_SPEC2_11_Render_parameters6, 
V2AddlRequestTests_SPEC2_11_Resource_parameters6)

> TCK: Contesting getParameterMap tests that verify an unmodifiable Map object
> ----------------------------------------------------------------------------
>
>                 Key: PLUTO-670
>                 URL: https://issues.apache.org/jira/browse/PLUTO-670
>             Project: Pluto
>          Issue Type: Bug
>          Components: tck
>    Affects Versions: 3.0.0
>            Reporter: Neil Griffin
>            Assignee: Neil Griffin
>            Priority: Major
>             Fix For: 3.0.1
>
>
> The test for V2AddlRequestTests_SPEC2_11_Action_parameters6 states:
> {quote}Details: "The getParameterMap method must return an unmodifiable Map 
> object"{quote}
> The tests verifies this by trying to mutate a map value and then verifying 
> that the mutation did not have any effect on the underlying map (a no-op):
> {code:java|title=AddlRequestTests_SPEC2_11_Action.java}
>         String tr2TestStringArray[] = {"Modified Value"};
>         portletReq.getParameterMap().put("inputval", tr2TestStringArray);
>         if ("V2AddlRequestTests_SPEC2_11_Action_parameters6"
>             .equals(portletReq.getParameterMap().get("inputval")[0])) {
>           tr2.setTcSuccess(true);
>         }
> {code}
> The following tests have the same type of logic:
> - V2AddlRequestTests_SPEC2_11_Event_parameters6
> - V2AddlRequestTests_SPEC2_11_Render_parameters6
> - V2AddlRequestTests_SPEC2_11_Resource_parameters6
> - V3HeaderPortletTests_SPEC15_Header_parameters6
> The [JavaDoc for 
> PortletRequest.getParameterMap()|https://portals.apache.org/pluto/portlet-3.0-apidocs/javax/portlet/PortletRequest.html#getParameterMap()]
>  states:
> {quote}Returns: an immutable Map containing parameter names as keys and 
> parameter values as map values, or an empty Map if no parameters exist.{quote}
> In order to fulfill this requirement, Liferay Portal wraps the underlying 
> parameter map with {{Collections.unmodifiableMap()}}. Because of this, 
> calling the {{put}} method throws an {{UnsupportedOperationException}} on 
> Liferay.
> The fix would be to have the test also pass if the {{put}} operation throws 
> {{UnsupportedOperationException}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to