portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [09/30] portals-pluto git commit: UpdatedPortletTests
Date Fri, 22 Apr 2016 08:58:28 GMT
UpdatedPortletTests


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

Branch: refs/heads/master
Commit: 3a0a180e054376cdb2978debce303ff7141224c6
Parents: 5602490
Author: Jayendran Anil Kumar <akumarj@de.ibm.com>
Authored: Mon Feb 29 12:57:56 2016 +0100
Committer: Jayendran Anil Kumar <akumarj@de.ibm.com>
Committed: Mon Feb 29 12:57:56 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/content/TestBundle.properties |  0
 .../PortletTests_GenericPortlet_ApiRender.java  | 31 +++++---------
 .../PortletTests_PortletConfig_ApiRender.java   | 44 ++++++++------------
 .../PortletTests_PortletConfig_ApiRender2.java  | 19 +++++++--
 ...ests_ResourceServingPortlet_ApiResource.java |  8 +++-
 .../src/main/webapp/WEB-INF/portlet.xml         | 21 ++++------
 6 files changed, 60 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/3a0a180e/portlet-tck_3.0/V2PortletTests/src/main/java/content/TestBundle.properties
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/content/TestBundle.properties b/portlet-tck_3.0/V2PortletTests/src/main/java/content/TestBundle.properties
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/3a0a180e/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_GenericPortlet_ApiRender.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_GenericPortlet_ApiRender.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_GenericPortlet_ApiRender.java
index 2ffcca5..9445e23 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_GenericPortlet_ApiRender.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_GenericPortlet_ApiRender.java
@@ -105,35 +105,26 @@ public class PortletTests_GenericPortlet_ApiRender extends GenericPortlet
{
       /* Details: "Method getPortletConfig(): Returns the PortletConfig       */
       /* object for the portlet"                                              */
       TestResult tr31 = tcd.getTestResultFailed(V2PORTLETTESTS_GENERICPORTLET_APIRENDER_GETPORTLETCONFIG);
-      PortletConfig pc = getPortletConfig();
-      
-      StringBuilder txt=new StringBuilder(128);
-      txt.append("The value is:").append(pc);
-      tr31.appendTcDetail(txt.toString());
+      String pc=getPortletConfig().getPortletName();
+      if(pc.equals("PortletTests_GenericPortlet_ApiRender")) {
+    	  tr31.setTcSuccess(true);
+      } else {
+    	  tr31.appendTcDetail("The PortletName does not match the actual name :"+pc.toString());
+      }
       tr31.writeTo(writer);
       
       /* TestCase: V2PortletTests_GenericPortlet_ApiRender_initA              */
       /* Details: "Method init(): Called when the portlet is initialized"     */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_GENERICPORTLET_APIRENDER_INITA);
-      try {
-          String name = "init";
-          Class<?> retType = void.class;
-          Class<?>[] parms = null;
-          tr0.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr0.appendTcDetail(e.toString());}
-       tr0.writeTo(writer);
-
+      if(this.initCalled==true) {
+    	  tr0.setTcSuccess(true);
+      }
+      tr0.writeTo(writer);
       /* TestCase: V2PortletTests_GenericPortlet_ApiRender_initB              */
       /* Details: "Method init(PortletConfig): Called when the portlet is     */
       /* initialized"                                                         */
       TestResult tr1 = tcd.getTestResultFailed(V2PORTLETTESTS_GENERICPORTLET_APIRENDER_INITB);
-      try {
-          String name = "init";
-          Class<?> retType = void.class;
-          Class<?>[] parms = {PortletConfig.class};
-          tr1.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr1.appendTcDetail(e.toString());}
-       tr1.writeTo(writer);
+      
 
       /* TestCase: V2PortletTests_GenericPortlet_ApiRender_processAction1     */
       /* Details: "Method processAction(ActionRequest, ActionResponse): If    */

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/3a0a180e/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 bc74c75..d7c2644 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
@@ -127,23 +127,16 @@ private static final Locale Locale = null;
     	 tr1.setTcSuccess(false);
     	 StringBuilder txt=new StringBuilder(128);
          txt.append("The Portlet Context is null");
-         tr1.appendTcDetail(txt.toString());
-    	  
+         tr1.appendTcDetail(txt.toString());	  
       }
-      
       tr1.writeTo(writer);
 
       /* TestCase: V2PortletTests_PortletConfig_ApiRender_getResourceBundle   */
       /* Details: "Method getResourceBundle(Locale): Returns the              */
       /* ResourceBundle for the specified locale"                             */
       TestResult tr2 = tcd.getTestResultSucceeded(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETRESOURCEBUNDLE);
-      Locale loc=java.util.Locale.getDefault();
-      ResourceBundle rb=portletConfig.getResourceBundle(loc);
-      StringBuilder txt2=new StringBuilder(128);
-      txt2.append("The value is").append(rb);
-      tr2.appendTcDetail(txt2.toString());
+      ResourceBundle rb=portletConfig.getResourceBundle(portletReq.getLocale());
       tr2.writeTo(writer);
-
       
       /* TestCase: V2PortletTests_PortletConfig_ApiRender_getInitParameter1   */
       /* Details: "Method getInitParameter(String): Returns a String          */
@@ -217,12 +210,10 @@ private static final Locale Locale = null;
       /* parameters as defined in the deployment descriptor"                  */
       TestResult tr7 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETDEFAULTNAMESPACE1);
       String str =portletConfig.getDefaultNamespace();
-      StringBuilder txt7=new StringBuilder(128);
       if(str.equals("https://www.apache.org")) {
     	  tr7.setTcSuccess(true);
       } else { 
-          txt7.append("The default namespace is :").append(str);
-          tr7.appendTcDetail(txt7.toString());
+          tr7.appendTcDetail("The default namespace is :"+str.toString());
          }   
       tr7.writeTo(writer);
       
@@ -230,18 +221,19 @@ private static final Locale Locale = null;
       /* Details: "Method getPublishingEventQNames(): Returns an              */
       /* java.util.Enumeration&lt;java.lang.String&gt; containing the         */
       /* publishing event qnames as defined in the deployment descriptor"     */
-      TestResult tr8 = tcd.getTestResultSucceeded(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETPUBLISHINGEVENTQNAMES1);
+      TestResult tr8 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETPUBLISHINGEVENTQNAMES1);
       Enumeration<QName> eventqname=portletConfig.getPublishingEventQNames();
       List<QName> list8=Collections.list(eventqname);
-      StringBuilder txt8=new StringBuilder(128);
-      txt8.append("Number of entries: ").append(list8.size()).append(", Values: ");
-      String sep = "";
       for (QName qn : list8) {
-    	  txt8.append(sep).append(qn.toString());
-    	  sep = ", ";
-      }
-      tr8.appendTcDetail(txt8.toString());
-      tr8.writeTo(writer);
+         if(list8.size()==1) {
+    	       if(list8.equals(qn.toString())) {
+    			 tr8.setTcSuccess(true); 
+    	       } 
+    	  } else {
+    	         tr8.appendTcDetail("EventQnames had invalid length" +list1.size());
+    	    }
+       }
+       tr8.writeTo(writer);
       
       /* TestCase: V2PortletTests_PortletConfig_ApiRender_getProcessingEventQNames1 */
       /* Details: "Method getProcessingEventQNames(): Returns an              */
@@ -287,11 +279,11 @@ private static final Locale Locale = null;
       /* deployment descriptor"                                               */
       TestResult tr11 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETCONTAINERRUNTIMEOPTIONS1);
       Map<String,String[]> runoption=portletConfig.getContainerRuntimeOptions();
-      String[] val2 = runoption.get("somename");
-      Set<String> keys = runoption.keySet();
-    		  
-    
+      int val1=runoption.size();
+      tr11.appendTcDetail("The values"+val1);
       
+      tr11.writeTo(writer);
+    
 
       /* TestCase: V2PortletTests_PortletConfig_ApiRender_getContainerRuntimeOptions2 */
       /* Details: "Method getContainerRuntimeOptions(): If the same option    */
@@ -315,7 +307,7 @@ private static final Locale Locale = null;
       /* Details: "Method getContainerRuntimeOptions(): Returns an empty      */
       /* map if no container runtime options have been defined "              */
       TestResult tr14 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER_GETCONTAINERRUNTIMEOPTIONS4);
-
+      
    }
 
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/3a0a180e/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
index fc7123a..77a942c 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
@@ -160,16 +160,27 @@ private static final String XMLConstants = null;
       /* Details: "Method getPublishingEventQNames(): Returns an empty        */
       /* Enumeration if there are no processing events are defined"           */
       TestResult tr4 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER2_GETPUBLISHINGEVENTQNAMES2);
-      Enumeration<QName> evntqnames=portletConfig.getPublishingEventQNames();
-      tr4.appendTcDetail("PublishingEvnet"+evntqnames.toString());
-      tr4.writeTo(writer);
+      Enumeration<QName> pubevntqname=portletConfig.getPublishingEventQNames();
+      List<QName> list4=Collections.list(pubevntqname);
+      if(list4.size()==0) {
+    	  tr4.setTcSuccess(true);
+      } else {
+    	  tr4.appendTcDetail("The Publish Event Qnames are "+list4.toString());
+      }
+       tr4.writeTo(writer);
 
 
       /* TestCase: V2PortletTests_PortletConfig_ApiRender2_getProcessingEventQNames2 */
       /* Details: "Method getProcessingEventQNames(): Returns an empty        */
       /* Enumeration if there are no processing events are defined"           */
       TestResult tr5 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER2_GETPROCESSINGEVENTQNAMES2);
-      
+      Enumeration<QName> proevntqname=portletConfig.getProcessingEventQNames();
+      List<QName> list5=Collections.list(proevntqname);
+      if(list5.size()==0) {
+    	  tr5.setTcSuccess(true);
+      } else {
+    	  tr5.appendTcDetail("The Process Event Qnames are "+list5.toString());
+      }
       tr5.writeTo(writer);
 
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/3a0a180e/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
index 98cd77e..19fd172 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
@@ -94,7 +94,13 @@ public class PortletTests_ResourceServingPortlet_ApiResource implements
Portlet,
       /* Details: "Method serveResource(ResourceRequest, ResourceResponse):   */
       /* is called to allow the portlet to generate resource content "        */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_RESOURCESERVINGPORTLET_APIRESOURCE_SERVERESOURCE);
-      
+      String param=portletReq.getMethod();
+      if(param.equals("GET")) {
+    	  tr0.setTcSuccess(true);
+      } else {
+    	  tr0.appendTcDetail("The Http Method type is :"+param);
+      }
+      tr0.writeTo(writer);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/3a0a180e/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml b/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
index b5767a3..7883f51 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
+++ b/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
@@ -38,14 +38,14 @@
          <name>param3</name>
          <value>value3</value>
       </init-param>
-      
+       
       <expiration-cache>0</expiration-cache>
       <supports>
          <mime-type>text/html</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       
-     <resource-bundle>org.apache.pluto.container.om.portlet.TestBundle</resource-bundle>
+     <resource-bundle>content/TestBundle</resource-bundle>
      
       <portlet-info>
          <title>PortletTests_PortletConfig_ApiRender</title>
@@ -55,13 +55,10 @@
       </supported-publishing-event>
    <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
    <container-runtime-option>
-         <name>Runtime-Option1</name>
-         <value>true</value>
-      </container-runtime-option>
-      <container-runtime-option>
-         <name>Runtime-Option2</name>
-         <value>value2</value>
+         <name>javax.portlet.escape.Xml</name>
+         <value>false</value>
       </container-runtime-option>
+      
    </portlet>
 
    <portlet>
@@ -239,8 +236,8 @@
       <identifier>tckPRP1</identifier>
       <qname>tck:tckPRP1</qname>
    </public-render-parameter>
-  <container-runtime-option>
-      <name>Runtime-Option-Portlet-App</name>
-      <value>false</value>
-   </container-runtime-option>
+   <container-runtime-option>
+         <name>javax.portlet.escape.Xml</name>
+         <value>false</value>
+      </container-runtime-option>
 </portlet-app>
\ No newline at end of file


Mime
View raw message