portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asfgr...@apache.org
Subject [1/2] portals-pluto git commit: PLUTO-686: TCK: Contesting tests that invoke portletConfig.getContainerRuntimeOptions
Date Tue, 30 Jan 2018 18:33:31 GMT
Repository: portals-pluto
Updated Branches:
  refs/heads/master 6f7653251 -> c573052f1


PLUTO-686: TCK: Contesting tests that invoke portletConfig.getContainerRuntimeOptions


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

Branch: refs/heads/master
Commit: a7eeb6f66169b7cefe1ff7ed836bd84646e96c8a
Parents: 6f76532
Author: vsingleton <vsingleton@gmail.com>
Authored: Tue Jan 30 10:47:54 2018 -0500
Committer: vsingleton <vsingleton@gmail.com>
Committed: Tue Jan 30 12:14:36 2018 -0500

----------------------------------------------------------------------
 portlet-tck_3.0/V2PortletTests/pom.xml          |  57 +++-
 .../PortletTests_PortletConfig_ApiRender.java   |  27 +-
 .../resources/xml-resources/liferay/portlet.xml | 275 +++++++++++++++++++
 .../src/main/webapp/WEB-INF/web.xml             |  13 +-
 portlet-tck_3.0/pom.xml                         |   2 +
 5 files changed, 361 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/a7eeb6f6/portlet-tck_3.0/V2PortletTests/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/pom.xml b/portlet-tck_3.0/V2PortletTests/pom.xml
index 0fd193d..f06b62f 100644
--- a/portlet-tck_3.0/V2PortletTests/pom.xml
+++ b/portlet-tck_3.0/V2PortletTests/pom.xml
@@ -100,6 +100,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>
@@ -117,7 +120,11 @@
    <profiles>
       <profile>
          <id>pluto</id>
-
+         <properties>
+            <expected.number>2</expected.number>
+            <expected.option>javax.portlet.servletDefaultSessionScope</expected.option>
+            <expected.portlet.value>PORTLET_SCOPE</expected.portlet.value>
+         </properties>
          <dependencies>
             <dependency>
                <groupId>org.apache.taglibs</groupId>
@@ -135,7 +142,53 @@
                <scope>compile</scope>
             </dependency>
          </dependencies>
-
+      </profile>
+      <profile>
+         <id>liferay</id>
+         <properties>
+            <expected.number>1</expected.number>
+            <expected.option>javax.portlet.escapeXml</expected.option>
+            <expected.portlet.value>true</expected.portlet.value>
+         </properties>
+         <build>
+            <plugins>
+               <plugin>
+                  <artifactId>maven-antrun-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>prepare-package</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                           <goal>run</goal>
+                        </goals>
+                        <configuration>
+                           <target>
+                              <copy file="${basedir}/src/main/webapp/WEB-INF/portlet.xml"
+                                    tofile="${basedir}/src/main/webapp/WEB-INF/portlet.tmp"
/>
+                              <copy file="${basedir}/src/main/resources/xml-resources/liferay/portlet.xml"
+                                    tofile="${basedir}/src/main/webapp/WEB-INF/portlet.xml"
+                                    overwrite="true" />
+                           </target>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>package</id>
+                        <phase>package</phase>
+                        <goals>
+                           <goal>run</goal>
+                        </goals>
+                        <configuration>
+                           <target>
+                              <move file="${basedir}/src/main/webapp/WEB-INF/portlet.tmp"
+                                    tofile="${basedir}/src/main/webapp/WEB-INF/portlet.xml"
+                                    overwrite="true" />
+                           </target>
+                        </configuration>
+                     </execution>
+                  </executions>
+               </plugin>
+            </plugins>
+         </build>
       </profile>
    </profiles>
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/a7eeb6f6/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender.java
index c71e50d..6644d36 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender.java
@@ -328,6 +328,14 @@ public class PortletTests_PortletConfig_ApiRender implements Portlet
{
       tr10.writeTo(writer);
 
       /*
+       * different containers expect different options
+       */
+      PortletContext portletContext = portletConfig.getPortletContext();
+      String expectedNumber = portletContext.getInitParameter("tck.EXPECTED_NUMBER");
+      String expectedOption = portletContext.getInitParameter("tck.EXPECTED_OPTION");
+      String expectedPortletValue = portletContext.getInitParameter("tck.EXPECTED_PORTLET_VALUE");
+
+      /*
        * TestCase:
        * V2PortletTests_PortletConfig_ApiRender_getContainerRuntimeOptions1
        */
@@ -339,9 +347,10 @@ public class PortletTests_PortletConfig_ApiRender implements Portlet
{
             V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETCONTAINERRUNTIMEOPTIONS1);
       Map<String, String[]> runoption1 = portletConfig
             .getContainerRuntimeOptions();
-      if (runoption1.size() == 2) {
+
+      if (runoption1.size() == Integer.parseInt(expectedNumber)) {
          if (runoption1 != null && runoption1
-               .containsKey("javax.portlet.servletDefaultSessionScope")) {
+               .containsKey(expectedOption)) {
             tr11.setTcSuccess(true);
          } else {
             tr11.appendTcDetail(
@@ -365,13 +374,11 @@ public class PortletTests_PortletConfig_ApiRender implements Portlet
{
             V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETCONTAINERRUNTIMEOPTIONS2);
       Map<String, String[]> runoption2 = portletConfig
             .getContainerRuntimeOptions();
-      String[] val5 = runoption2
-            .get("javax.portlet.servletDefaultSessionScope");
-      if (runoption2.size() == 2) {
+      String[] val5 = runoption2.get(expectedOption);
+      if (runoption2.size() == Integer.parseInt(expectedNumber)) {
          if (runoption2 != null
-               && runoption2
-                     .containsKey("javax.portlet.servletDefaultSessionScope")
-               && val5[0].equals("PORTLET_SCOPE")) {
+               && runoption2.containsKey(expectedOption)
+               && val5[0].equals(expectedPortletValue)) {
             tr12.setTcSuccess(true);
          } else {
             tr12.appendTcDetail(
@@ -394,8 +401,8 @@ public class PortletTests_PortletConfig_ApiRender implements Portlet {
             V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETCONTAINERRUNTIMEOPTIONS3);
       Map<String, String[]> runoption3 = portletConfig
             .getContainerRuntimeOptions();
-      if (runoption3.size() == 2) {
-         if (runoption3 != null && !runoption3.equals("newruntimeoption")) {
+      if (runoption3.size() == Integer.parseInt(expectedNumber)) {
+         if (runoption3 != null && !runoption3.containsKey("newruntimeoption")) {
             tr13.setTcSuccess(true);
          } else {
             tr13.appendTcDetail(

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/a7eeb6f6/portlet-tck_3.0/V2PortletTests/src/main/resources/xml-resources/liferay/portlet.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/resources/xml-resources/liferay/portlet.xml
b/portlet-tck_3.0/V2PortletTests/src/main/resources/xml-resources/liferay/portlet.xml
new file mode 100644
index 0000000..46c4ae0
--- /dev/null
+++ b/portlet-tck_3.0/V2PortletTests/src/main/resources/xml-resources/liferay/portlet.xml
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.     
+-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+   xmlns:tck="http://www.apache.org/portals/pluto/portlet-tck_3.0"
+   version="2.0" id="V2PortletTests">
+
+   <portlet>
+      <portlet-name>PortletTests_PortletConfig_ApiRender</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_PortletConfig_ApiRender</portlet-class>
+      <init-param>
+         <name>param1</name>
+         <value>value1</value>
+      </init-param>
+       <init-param>
+         <name>param2</name>
+         <value>value2</value>
+      </init-param>
+       <init-param>
+         <name>param3</name>
+         <value>value3</value>
+      </init-param>
+       
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en</supported-locale>
+      
+     <resource-bundle>javax.portlet.tck.portlets.TestBundle</resource-bundle>
+     
+      <portlet-info>
+         <title>PortletTests_PortletConfig_ApiRender</title>
+      </portlet-info>
+      
+       <supported-processing-event>
+       <qname>tck:PortletTests_Event_ApiEvent</qname>
+      </supported-processing-event>
+      
+      <supported-publishing-event>
+      
+         <qname>tck:PortletTests_Event_ApiEvent</qname>
+      </supported-publishing-event>
+      
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+     
+  <container-runtime-option> 
+      <name>javax.portlet.escapeXml</name> 
+      <value>true</value> 
+  </container-runtime-option>
+  <container-runtime-option>
+      <name>newruntimeoption</name> 
+      <value>option</value> 
+  </container-runtime-option>
+  
+      
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_PortletConfig_ApiRender2</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_PortletConfig_ApiRender2</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <portlet-info>
+         <title>PortletTests_PortletConfig_ApiRender2</title>
+      </portlet-info> 
+    </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_PortletMode_ApiRender</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_PortletMode_ApiRender</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_PortletMode_ApiRender</title>
+      </portlet-info>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_WindowState_ApiRender</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_WindowState_ApiRender</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_WindowState_ApiRender</title>
+      </portlet-info>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_Portlet_ApiRender</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_Portlet_ApiRender</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_Portlet_ApiRender</title>
+      </portlet-info>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_Portlet_ApiAction</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_Portlet_ApiAction</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_Portlet_ApiAction</title>
+      </portlet-info>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_Event_ApiEvent</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_Event_ApiEvent</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_Event_ApiEvent</title>
+      </portlet-info>
+      <supported-publishing-event>
+         <qname>tck:PortletTests_Event_ApiEvent</qname>
+      </supported-publishing-event>
+      <supported-publishing-event>
+         <qname>tck:PortletTests_Event_ApiEvent2</qname>
+      </supported-publishing-event>
+      <supported-publishing-event>
+         <name>PortletTests_Event_ApiEvent_localPart</name>
+      </supported-publishing-event>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_Event_ApiEvent_event</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_Event_ApiEvent_event</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_Event_ApiEvent_event</title>
+      </portlet-info>
+      <supported-processing-event>
+         <qname>tck:PortletTests_Event_ApiEvent</qname>
+      </supported-processing-event>
+      <supported-processing-event>
+         <qname>tck:PortletTests_Event_ApiEvent2</qname>
+      </supported-processing-event>
+      <supported-processing-event>
+         <name>PortletTests_Event_ApiEvent_localPart</name>
+      </supported-processing-event>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_EventPortlet_ApiEvent</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_EventPortlet_ApiEvent</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_EventPortlet_ApiEvent</title>
+      </portlet-info>
+      <supported-publishing-event>
+         <qname>tck:PortletTests_EventPortlet_ApiEvent</qname>
+      </supported-publishing-event>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_EventPortlet_ApiEvent_event</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_EventPortlet_ApiEvent_event</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_EventPortlet_ApiEvent_event</title>
+      </portlet-info>
+      <supported-processing-event>
+         <qname>tck:PortletTests_EventPortlet_ApiEvent</qname>
+      </supported-processing-event>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_ResourceServingPortlet_ApiResource</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_ResourceServingPortlet_ApiResource</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_ResourceServingPortlet_ApiResource</title>
+      </portlet-info>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+
+   <portlet>
+      <portlet-name>PortletTests_GenericPortlet_ApiRender</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.PortletTests_GenericPortlet_ApiRender</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>PortletTests_GenericPortlet_ApiRender</title>
+      </portlet-info>
+   <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+   </portlet>
+  <default-namespace>https://www.apache.org</default-namespace>
+   <event-definition>
+      <qname>tck:PortletTests_Event_ApiEvent</qname>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <event-definition>
+      <qname>tck:PortletTests_Event_ApiEvent2</qname>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <event-definition>
+      <name>PortletTests_Event_ApiEvent_localPart</name>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <event-definition>
+      <qname>tck:PortletTests_EventPortlet_ApiEvent</qname>
+      <value-type>java.lang.String</value-type>
+   </event-definition>
+   <public-render-parameter>
+      <identifier>tckPRP1</identifier>
+      <qname>tck:tckPRP1</qname>
+   </public-render-parameter>
+   <container-runtime-option> 
+      <name>javax.portlet.escapeXml</name> 
+      <value>APPLICATION</value> 
+  </container-runtime-option>
+</portlet-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/a7eeb6f6/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/web.xml b/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/web.xml
index bea8d08..aa79a15 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/web.xml
+++ b/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/web.xml
@@ -19,5 +19,16 @@
 -->
 <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-PortletTests</display-name>
-
+   <context-param>
+      <param-name>tck.EXPECTED_NUMBER</param-name>
+      <param-value>${expected.number}</param-value>
+   </context-param>
+   <context-param>
+      <param-name>tck.EXPECTED_OPTION</param-name>
+      <param-value>${expected.option}</param-value>
+   </context-param>
+   <context-param>
+      <param-name>tck.EXPECTED_PORTLET_VALUE</param-name>
+      <param-value>${expected.portlet.value}</param-value>
+   </context-param>
 </web-app>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/a7eeb6f6/portlet-tck_3.0/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/pom.xml b/portlet-tck_3.0/pom.xml
index d62b2d7..ecab485 100644
--- a/portlet-tck_3.0/pom.xml
+++ b/portlet-tck_3.0/pom.xml
@@ -517,6 +517,8 @@
                      <archiveClasses>false</archiveClasses>
                      <failOnMissingWebXml>false</failOnMissingWebXml>
                      <packagingExcludes>
+                        WEB-INF/classes/xml-resources/liferay,
+                        WEB-INF/classes/xml-resources/liferay/portlet.xml,
                         WEB-INF/liferay-portlet.xml,
                         WEB-INF/classes/log4j.properties
                      </packagingExcludes>


Mime
View raw message