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

"Neil Griffin (JIRA)" <[email protected]>
Newsgroups gmane.comp.jakarta.pluto.devel
Message-ID <[email protected]>
    [ 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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.