portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asfgr...@apache.org
Subject portals-pluto git commit: PLUTO-676 TCK: Contesting V2EnvironmentTests_PortletContext_ApiRender_getRealPath1
Date Fri, 05 Jan 2018 18:01:58 GMT
Repository: portals-pluto
Updated Branches:
  refs/heads/master 75353b1fb -> d8351e585


PLUTO-676 TCK: Contesting V2EnvironmentTests_PortletContext_ApiRender_getRealPath1


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/d8351e58
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/d8351e58
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/d8351e58

Branch: refs/heads/master
Commit: d8351e585a8b0d91bb2dc5af3fe5a50bce2fa839
Parents: 75353b1
Author: Neil Griffin <neil.griffin.scm@gmail.com>
Authored: Fri Jan 5 13:01:38 2018 -0500
Committer: Neil Griffin <neil.griffin.scm@gmail.com>
Committed: Fri Jan 5 13:01:38 2018 -0500

----------------------------------------------------------------------
 portlet-tck_3.0/V2EnvironmentTests/pom.xml         | 11 +++++++++++
 .../EnvironmentTests_PortletContext_ApiRender.java | 17 +++++++++++------
 .../src/main/webapp/WEB-INF/web.xml                |  6 +++++-
 3 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d8351e58/portlet-tck_3.0/V2EnvironmentTests/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2EnvironmentTests/pom.xml b/portlet-tck_3.0/V2EnvironmentTests/pom.xml
index d32e697..3a31199 100644
--- a/portlet-tck_3.0/V2EnvironmentTests/pom.xml
+++ b/portlet-tck_3.0/V2EnvironmentTests/pom.xml
@@ -88,6 +88,8 @@
       <!-- put all portlets from this module on the same page -->
       <page.file.xsl>plutoMultiPortletPage.xsl</page.file.xsl>
 
+      <portletcontext.getrealpath.supported>true</portletcontext.getrealpath.supported>
+
    </properties>
 
    <build>
@@ -100,6 +102,9 @@
          <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-war-plugin</artifactId>
+            <configuration>
+               <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
+            </configuration>
          </plugin>
          <!-- Transform the portlet XML into test properties XML file -->
          <plugin>
@@ -126,6 +131,12 @@
 
    <profiles>
       <profile>
+         <id>liferay</id>
+         <properties>
+            <portletcontext.getrealpath.supported>false</portletcontext.getrealpath.supported>
+         </properties>
+      </profile>
+      <profile>
          <id>pluto</id>
 
          <dependencies>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d8351e58/portlet-tck_3.0/V2EnvironmentTests/src/main/java/javax/portlet/tck/portlets/EnvironmentTests_PortletContext_ApiRender.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2EnvironmentTests/src/main/java/javax/portlet/tck/portlets/EnvironmentTests_PortletContext_ApiRender.java
b/portlet-tck_3.0/V2EnvironmentTests/src/main/java/javax/portlet/tck/portlets/EnvironmentTests_PortletContext_ApiRender.java
index 768618c..218d604 100644
--- a/portlet-tck_3.0/V2EnvironmentTests/src/main/java/javax/portlet/tck/portlets/EnvironmentTests_PortletContext_ApiRender.java
+++ b/portlet-tck_3.0/V2EnvironmentTests/src/main/java/javax/portlet/tck/portlets/EnvironmentTests_PortletContext_ApiRender.java
@@ -366,13 +366,18 @@ public class EnvironmentTests_PortletContext_ApiRender implements Portlet
{
     TestResult tr16 =
         tcd.getTestResultFailed(V2ENVIRONMENTTESTS_PORTLETCONTEXT_APIRENDER_GETREALPATH1);
     try {
-      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);
+      boolean getRealPathSupported =
+          "true".equalsIgnoreCase(pc.getInitParameter("javax.portlet.portletcontext.GET_REAL_PATH_SUPPORTED"));
+      if (getRealPathSupported) {
+        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.");
+        }
       } else {
-        tr16.appendTcDetail("Failed because real path cannot be determined.");
+        tr16.appendTcDetail("Portlet container does not support calling PortletContext.getRealPath()
for the requested file.");
+        tr16.setTcSuccess(true);
       }
     } catch (Exception e) {
       tr16.appendTcDetail(e.toString());

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d8351e58/portlet-tck_3.0/V2EnvironmentTests/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2EnvironmentTests/src/main/webapp/WEB-INF/web.xml b/portlet-tck_3.0/V2EnvironmentTests/src/main/webapp/WEB-INF/web.xml
index ee9fa76..60cfcba 100644
--- a/portlet-tck_3.0/V2EnvironmentTests/src/main/webapp/WEB-INF/web.xml
+++ b/portlet-tck_3.0/V2EnvironmentTests/src/main/webapp/WEB-INF/web.xml
@@ -19,7 +19,11 @@
 -->
 <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>javax.portlet-tck-EnvironmentTests</display-name>
-   
+
+   <context-param>
+      <param-name>javax.portlet.portletcontext.GET_REAL_PATH_SUPPORTED</param-name>
+      <param-value>${portletcontext.getrealpath.supported}</param-value>
+   </context-param>
    <servlet>
       <servlet-name>V2EnvironmentTests_PortletRequestDispatcher_ApiRender_PortletRequest_Include</servlet-name>
       <servlet-class>javax.portlet.tck.servlets.V2EnvironmentTests_PortletRequestDispatcher_ApiRender_PortletRequest_Include</servlet-class>


Mime
View raw message