portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [06/10] portals-pluto git commit: Completed portlet hub render state tests
Date Thu, 13 Oct 2016 07:59:49 GMT
Completed portlet hub render state tests


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

Branch: refs/heads/master
Commit: 21d78aedd80b4eeec73ce1d74c376c07ebea2659
Parents: 814d5a1
Author: Scott Nicklous <msnicklous@apache.org>
Authored: Wed Oct 12 07:26:39 2016 +0200
Committer: Scott Nicklous <msnicklous@apache.org>
Committed: Wed Oct 12 07:26:39 2016 +0200

----------------------------------------------------------------------
 .../portlets/PortletHubTests_SPEC_23_JSRS.java  | 11 -----
 .../resources/xml-resources/additionalTCs.xml   |  1 -
 .../javascript/PortletHubTests_SPEC_23_JSRS.js  | 47 +++++++++++---------
 3 files changed, 25 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/21d78aed/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JSRS.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JSRS.java
b/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JSRS.java
index 39e0aa5..bae68d0 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JSRS.java
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JSRS.java
@@ -28,7 +28,6 @@ import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPE
 import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JSRS_SETRENDERSTATE7;
 import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JSRS_SETRENDERSTATE8;
 import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JSRS_SETRENDERSTATE9;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JSRS_SETRENDERSTATEA;
 
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -180,16 +179,6 @@ public class PortletHubTests_SPEC_23_JSRS implements Portlet {
          result.writeTo(writer);
       }
 
-      /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderStateA                   */
-      /* Details: "The portlet hub setRenderState function allows setting the state */
-      /* back to the original test data"                                            */
-      {
-         TestButtonAsync button = new TestButtonAsync(V3PORTLETHUBTESTS_SPEC_23_JSRS_SETRENDERSTATEA);
-         button.writeTo(writer);
-         TestResultAsync result = tcd.getTestResultAsyncFailed(V3PORTLETHUBTESTS_SPEC_23_JSRS_SETRENDERSTATEA);
-         result.writeTo(writer);
-      }
-
       writer.write("<script>");
       writer.write("   var tck = tck || {};");
       writer.write("   tck.PortletHubTests_SPEC_23_JSRS = {};");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/21d78aed/portlet-tck_3.0/V3PortletHubTests/src/main/resources/xml-resources/additionalTCs.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/resources/xml-resources/additionalTCs.xml
b/portlet-tck_3.0/V3PortletHubTests/src/main/resources/xml-resources/additionalTCs.xml
index 003c7fe..1d64666 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/resources/xml-resources/additionalTCs.xml
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/resources/xml-resources/additionalTCs.xml
@@ -170,7 +170,6 @@
 <entry key="V3PortletHubTests_SPEC_23_JSRS_setRenderState8">V3PortletHubTests</entry>
 <entry key="V3PortletHubTests_SPEC_23_JSRS_setRenderState9">V3PortletHubTests</entry>
 <entry key="V3PortletHubTests_SPEC_23_JSRS_setRenderState0">V3PortletHubTests</entry>
-<entry key="V3PortletHubTests_SPEC_23_JSRS_setRenderStateA">V3PortletHubTests</entry>
 <entry key="V3PortletHubTests_SPEC_23_JSAction_Action1">V3PortletHubTests</entry>
 <entry key="V3PortletHubTests_SPEC_23_JSAction_Action2">V3PortletHubTests</entry>
 <entry key="V3PortletHubTests_SPEC_23_JSAction_Action3">V3PortletHubTests</entry>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/21d78aed/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JSRS.js
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JSRS.js
b/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JSRS.js
index adbd8a4..560ebab 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JSRS.js
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JSRS.js
@@ -80,7 +80,7 @@
    }
    
    function execute () {
-      var update, testFunction, hub, myPromise,
+      var update, testFunction, hub, myPromise, deleteAllParameters = false, 
           pid = tck.PortletHubTests_SPEC_23_JSRS.pid;
 
       /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderState1                   */
@@ -174,7 +174,7 @@
       /* be deleted"                                                                */
       document.getElementById('V3PortletHubTests_SPEC_23_JSRS_setRenderState9-clickme').onclick
= function () {
          var state = hub.newState();
-         state.setValue('testcase', 'V3PortletHubTests_SPEC_23_JSRS_setRenderState9');
+         deleteAllParameters = true;
          hub.setRenderState(state);
       }
 
@@ -184,20 +184,13 @@
       document.getElementById('V3PortletHubTests_SPEC_23_JSRS_setRenderState0-clickme').onclick
= function () {
          var state = hub.newState();
          state.setValue('testcase', 'V3PortletHubTests_SPEC_23_JSRS_setRenderState0');
-         hub.setRenderState(state);
-      }
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderStateA                   */
-      /* Details: "The portlet hub setRenderState function allows setting the state */
-      /* back to the original test data"                                            */
-      document.getElementById('V3PortletHubTests_SPEC_23_JSRS_setRenderStateA-clickme').onclick
= function () {
-         var state = hub.newState();
-         state.setValue('testcase', 'V3PortletHubTests_SPEC_23_JSRS_setRenderStateA');
+         state.setValue('param1', 'val1');
+         state.setValue('param2', ['val1', 'val2']);
          hub.setRenderState(state);
       }
 
       update = function (type, state) {
-         var msg, params;
+         var msg, params, cnt, param;
    
          /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderState1                   */
          /* Details: "The portlet hub setRenderState function causes the onStateChange */
@@ -301,22 +294,32 @@
          /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderState9                   */
          /* Details: "The portlet hub setRenderState function allows all parameters to */
          /* be deleted"                                                                */
-         if (state.getValue('testcase') === 'V3PortletHubTests_SPEC_23_JSRS_setRenderState9')
{
-            setSuccess('V3PortletHubTests_SPEC_23_JSRS_setRenderState9', 'Not implemented.');
+         if (deleteAllParameters) {
+            deleteAllParameters = false;
+            cnt = 0; 
+            params = state.parameters;
+            for (var param in params) {
+               if (params.hasOwnProperty(param)) {
+                  cnt++;
+               }
+            }
+            msg = null;
+            if (cnt !== 0) {
+               msg = 'Parameters are still present.';
+            }
+            setSuccess('V3PortletHubTests_SPEC_23_JSRS_setRenderState9', msg);
          }
    
          /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderState0                   */
          /* Details: "The portlet hub setRenderState function allows several           */
          /* parameters to be set"                                                      */
          if (state.getValue('testcase') === 'V3PortletHubTests_SPEC_23_JSRS_setRenderState0')
{
-            setSuccess('V3PortletHubTests_SPEC_23_JSRS_setRenderState0', 'Not implemented.');
-         }
-   
-         /* TestCase: V3PortletHubTests_SPEC_23_JSRS_setRenderStateA                   */
-         /* Details: "The portlet hub setRenderState function allows setting the state */
-         /* back to the original test data"                                            */
-         if (state.getValue('testcase') === 'V3PortletHubTests_SPEC_23_JSRS_setRenderStateA')
{
-            setSuccess('V3PortletHubTests_SPEC_23_JSRS_setRenderStateA', 'Not implemented.');
+            var params = {};
+            params.param1 = ['val1'];
+            params.param2 = ['val1', 'val2'];
+            params.testcase = ['V3PortletHubTests_SPEC_23_JSRS_setRenderState0'];
+            msg = checkParams(params, state.parameters);
+            setSuccess('V3PortletHubTests_SPEC_23_JSRS_setRenderState0', msg);
          }
 
       }


Mime
View raw message