Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-74114 Make Liferay compatible with version 2.0 tests in the Portlet 3.0 TCK
  3. LPS-76513

Portlet 3.0 TCK: During dispatching, javax.servlet.include.context_path attribute value isn't equal to return value of getContextPath

    Details

      Description

      Test Failures

      Details: "If the request dispatcher is obtained through the getRequestDispatcher method, the portlet request attribute javax.servlet.include.context_path will be set, and equals the value from HTTPServletRequest.getContextPath for the first servlet in the include chain.

      Details: In a servlet included by the target of an include, the portlet request attribute javax.servlet.include.context_path will be set, and reflects the path values of the included servlet. Error: /tck-V2DispatcherTests5 does not equal /o/tck-V2DispatcherTests5.

      Details: In a servlet included by the target of a forward, the portlet request attribute javax.servlet.include.context_path will be set, and reflects the path values of the included servlet. Error: /tck-V2DispatcherTests6 does not equal /o/tck-V2DispatcherTests6.

      There are 32 test cases fail with these kind of causes:

      • V2DispatcherTests_SPEC2_19_IncludeServletAction_attributes2
      • V2DispatcherTests_SPEC2_19_IncludeServletAction_attributes2a
      • V2DispatcherTests_SPEC2_19_IncludeServletEvent_attributes2
      • V2DispatcherTests_SPEC2_19_IncludeServletEvent_attributes2a
      • V2DispatcherTests_SPEC2_19_IncludeServletRender_attributes2
      • V2DispatcherTests_SPEC2_19_IncludeServletRender_attributes2a
      • V2DispatcherTests_SPEC2_19_IncludeServletResource_attributes2
      • V2DispatcherTests_SPEC2_19_IncludeServletResource_attributes2a
      • V2DispatcherTests2_SPEC2_19_IncludeJSPAction_attributes2
      • V2DispatcherTests2_SPEC2_19_IncludeJSPAction_attributes2a
      • V2DispatcherTests2_SPEC2_19_IncludeJSPEvent_attributes2
      • V2DispatcherTests2_SPEC2_19_IncludeJSPEvent_attributes2a
      • V2DispatcherTests2_SPEC2_19_IncludeJSPRender_attributes2
      • V2DispatcherTests2_SPEC2_19_IncludeJSPRender_attributes2a
      • V2DispatcherTests2_SPEC2_19_IncludeJSPResource_attributes2
      • V2DispatcherTests2_SPEC2_19_IncludeJSPResource_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletAction_attributes2
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletAction_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletEvent_attributes2
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletEvent_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletRender_attributes2
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletRender_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletResource_attributes2
      • V2DispatcherTests5_SPEC2_19_IncThenIncludeServletResource_attributes2a
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletAction_attributes2
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletAction_attributes2a
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletEvent_attributes2
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletEvent_attributes2a
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletRender_attributes2
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletRender_attributes2a
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletResource_attributes2
      • V2DispatcherTests6_SPEC2_19_FwdThenIncludeServletResource_attributes2a

      Additionally, 3 other test cases fail with similar reason:

      • V2RequestTests_PortletRequest_ApiAction_getContextPath1
      • V2RequestTests_PortletRequest_ApiEvent_getContextPath1
      • V2RequestTests_PortletRequest_ApiResource_getContextPath1

      Background

      The 32 test cases compare the getContextPath() return value with the attribute value of javax.servlet.include.context_path. The method return value has /o at the beginning while the attribute value doesn't.

      Liferay behavior doesn't meet the requirement of PLT 25.5.1, 25.6.1.

      In Liferay, during dispatching, the attribute value of javax.servlet.include.context_path is set into the request in Equinox DispatchTargets.doDispatch method:

      setter.setAttribute("javax.servlet.include.context_path", this.contextController.getContextPath());

      On the other hand, the request.getContextPath() return value is from contextController.getFullContextPath(), which has an HTTP service endpoint appended at the beginning – the /o.

       

      The 3 test cases in V2RequestTests expect the context path to be equal to a hard coded value, which doesn't contain the endpoint info.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 17 weeks, 1 day ago