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

TCK: Contesting V2EnvironmentTests_PortletContext_ApiRender_getRealPath1

    XMLWordPrintableJSON

Details

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

    Description

      The JavaDoc for PortletContext.getRealPath() states:

      Returns a String containing the real path for a given virtual path. For example, the path /index.html returns the absolute file path of the portlet container file system.
      The real path returned will be in a form appropriate to the computer and operating system on which the portlet container is running, including the proper path separators. This method returns null if the portlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).

      In the case of Liferay Portal, WAR artifacts are not unpacked which means it is impossible for the following code in V2EnvironmentTests_PortletContext_ApiRender_getRealPath1 to pass with success:

      V2EnvironmentTests_PortletContext_ApiRender_getRealPath1.java
            if (pc.getRealPath(
                "/WEB-INF/V2EnvironmentTests_PortletContext_ApiRender_getMimeType1.html") != null) {
              tr16.appendTcDetail(pc
                  .getRealPath("/WEB-INF/V2EnvironmentTests_PortletContext_ApiRender_getMimeType1.html"));
              tr16.setTcSuccess(true);
            } else {
              tr16.appendTcDetail("Failed because real path cannot be determined.");
            }
      

      The proposed solution is to introduce the following context parameter into the WEB-INF/web.xml descriptor:

      WEB-INF/web.xml
         <context-param>
            <param-name>javax.portlet.portletcontext.GET_REAL_PATH_SUPPORTED</param-name>
            <param-value>${portletcontext.getrealpath.supported}</param-value>
         </context-param>
      

      The default value of the Maven property portletcontext.getrealpath.supported would be true, but for the "liferay" profile, the value would be overridden to false.

      The test would then be modified to pass if the feature is not supported.

      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: