[jira] [Commented] (PLUTO-670) TCK: Contesting getParameterMap tests that verify an "unmodifiable" Map object

2018-05-02 Thread Neil Griffin (JIRA)

[ 
https://issues.apache.org/jira/browse/PLUTO-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461717#comment-16461717
 ] 

Neil Griffin commented on PLUTO-670:


See also commit 
[5dc0c83c6c9a9d07f3b6770036cfdaf5fc66647c|https://github.com/apache/portals-pluto/commit/5dc0c83c6c9a9d07f3b6770036cfdaf5fc66647c].

> 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
> - V3HeaderPortletTests_SPEC14_PortletRequest_ApiHeader_getPrivateParameterMap2
> - V3HeaderPortletTests_SPEC14_PortletRequest_ApiHeader_getPublicParameterMap2
> 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)


[jira] [Commented] (PLUTO-670) TCK: Contesting getParameterMap tests that verify an "unmodifiable" Map object

2018-02-02 Thread Neil Griffin (JIRA)

[ 
https://issues.apache.org/jira/browse/PLUTO-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16350667#comment-16350667
 ] 

Neil Griffin commented on PLUTO-670:


See also commit 
[db5b343d0d88fb97968201b86d839bc9016d8082|https://github.com/apache/portals-pluto/commit/db5b343d0d88fb97968201b86d839bc9016d8082].

> 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)