Uploaded image for project: 'Pluto'
  1. Pluto
  2. PLUTO-670

TCK: Contesting getParameterMap tests that verify an "unmodifiable" Map object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.1
    • tck
    • None

    Description

      The test for V2AddlRequestTests_SPEC2_11_Action_parameters6 states:

      Details: "The getParameterMap method must return an unmodifiable Map object"

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

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

      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() states:

      Returns: an immutable Map containing parameter names as keys and parameter values as map values, or an empty Map if no parameters exist.

      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.

      Attachments

        Activity

          People

            ngriffin7a Neil Griffin (Inactive)
            ngriffin7a Neil Griffin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: