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

TCK: Contesting tests that invoke a ResourceURL that was written to the response with BaseURL.write(Writer writer, boolean escapeXML) when passing escapeXML=true

Details

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

    Description

      The following tests attempt to invoke a ResourceURL that was written to the response with the BaseURL.write(Writer writer, boolean escapeXML) method when passing escapeXML=true:

      • V2URLTests_BaseURL_ApiRenderResurl_writeB1
      • V2URLTests_PortletURLGenerationListener_ApiRenderResurl_filterResourceURL3

      These tests pass on Pluto since it generates URLs that do not contain the ampersand (&) character. However, on Liferay Portal these tests fail since it generates URLs that use the ampersand character to separate URL name=value pairs. This results in URLs that look like the following:

      http://localhost:8080/web/guest/v2urltests8
      ?p_p_id=URLTests_PortletURLGenerationListener_ApiRenderResurl_WAR_tckV2URLTests
      &p_p_lifecycle=2
      &p_p_state=normal
      &p_p_mode=view
      &p_p_cacheability=cacheLevelPage
      &_URLTests_PortletURLGenerationListener_ApiRenderResurl_WAR_tckV2URLTests_tc=V2URLTests_PortletURLGenerationListener_ApiRenderResurl_filterResourceURL3
      &_URLTests_PortletURLGenerationListener_ApiRenderResurl_WAR_tckV2URLTests_PUGL=Resource
      &_URLTests_PortletURLGenerationListener_ApiRenderResurl_WAR_tckV2URLTests_PUGL2=Resource

      Since the ampersand character is encoded as & the URL name=value pairs are not processed correctly by the underlying servlet container.

      The proposed solution is to add a Liferay "Friendly URL" to the WEB-INF/liferay-portlet.xml descriptor. This will only be enabled with the "liferay" profile is activated on the Maven command line. The friendly URL will be more not contain any ampersand characters.

      Attachments

        Activity

          asfgriff Neil Griffin added a comment - - edited

          @vsingleton: Issues like this were previously fixed under PLUTO-662. Please provide a fix similar to Git commits 18e2e6eab4ee49530fc64c5f185086858b344c47 (only the friendly-url-routes.xml file) and eba41878cf1c3bc8fe66188c9673176c2168c5a4.

          asfgriff Neil Griffin added a comment - - edited @ vsingleton : Issues like this were previously fixed under PLUTO-662 . Please provide a fix similar to Git commits 18e2e6eab4ee49530fc64c5f185086858b344c47  (only the friendly-url-routes.xml file) and eba41878cf1c3bc8fe66188c9673176c2168c5a4 .

          This was tested against master:
          https://github.com/ngriffin7a/portals-pluto/pull/19

          NOTE: this issue is officially related to PLUTO-662 since the friendly url mapping from each war could potential affect one another, but with this PR above they will not conflict.

          vsingleton Vernon Singleton added a comment - This was tested against master: https://github.com/ngriffin7a/portals-pluto/pull/19 NOTE: this issue is officially related to PLUTO-662 since the friendly url mapping from each war could potential affect one another, but with this PR above they will not conflict.
          asfgriff Neil Griffin added a comment - - edited
          asfgriff Neil Griffin added a comment - - edited Fixed in commit 2e6b997e76b73729a66c603bcf2da7711ae563ff

          Addition fixes needed for filterResourceURL3 method.
          Tested on against master:
          https://github.com/ngriffin7a/portals-pluto/pull/20

          vsingleton Vernon Singleton added a comment - Addition fixes needed for filterResourceURL3 method. Tested on against master: https://github.com/ngriffin7a/portals-pluto/pull/20
          asfgriff Neil Griffin added a comment - - edited
          asfgriff Neil Griffin added a comment - - edited See also commit ade6250a3468b8855741a96701467833cdca0104

          People

            vsingleton Vernon Singleton
            ngriffin7a Neil Griffin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: