portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [3/3] portals-pluto git commit: got first batch of portlet hub tests working in the browser
Date Mon, 12 Sep 2016 03:30:45 GMT
got first batch of portlet hub tests working in the browser


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

Branch: refs/heads/master
Commit: dad329961120038e73b49bbc6d2fdfeac1531fd3
Parents: 44574a2
Author: Scott Nicklous <msnicklous@apache.org>
Authored: Sun Sep 11 19:29:28 2016 +0200
Committer: Scott Nicklous <msnicklous@apache.org>
Committed: Sun Sep 11 19:29:28 2016 +0200

----------------------------------------------------------------------
 .../src/main/docs/ModuleAssertions.csv          |   2 +-
 .../portlets/PortletHubTests_SPEC_23_JS.java    |  74 ++--
 .../portlet/tck/util/ModuleTestCaseDetails.java |   6 +-
 .../javascript/PortletHubTests_SPEC_23_JS.js    | 372 +++++++++++++------
 4 files changed, 285 insertions(+), 169 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/dad32996/portlet-tck_3.0/V3PortletHubTests/src/main/docs/ModuleAssertions.csv
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/docs/ModuleAssertions.csv b/portlet-tck_3.0/V3PortletHubTests/src/main/docs/ModuleAssertions.csv
index 87ab8e8..6a5955c 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/docs/ModuleAssertions.csv
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/docs/ModuleAssertions.csv
@@ -18,7 +18,7 @@ PARMS outputPath=c:\temp\gen
 Class / Section;Keywords;Name;Testable;Description
 PortletHubTests;;;;
 SPEC_23;JS;register1;TRUE;The portlet hub provides a global namespace var portlet of type
object
-SPEC_23;JS;register2;TRUE;The global namespace var portlet property register is type function
+SPEC_23;JS;register2;TRUE;The global portlet object register property is type function
 SPEC_23;JS;register3;TRUE;The portlet hub register function throws an IllegalArgumentException
if no portlet ID argument is provided
 SPEC_23;JS;register4;TRUE;The portlet hub register function throws an IllegalArgumentException
if too many (>1) arguments are provided
 SPEC_23;JS;register5;TRUE;The portlet hub register function throws an IllegalArgumentException
if the portlet ID is not a string

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/dad32996/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JS.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JS.java
b/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JS.java
index a7cdf4c..acd498c 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JS.java
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/portlets/PortletHubTests_SPEC_23_JS.java
@@ -18,52 +18,23 @@
 
 package javax.portlet.tck.portlets;
 
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS1;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS2;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS3;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS4;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS5;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS6;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS7;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS8;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_CONSTANTS9;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT1;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT2;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT3;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT4;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT5;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT6;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT7;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT8;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT9;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINITA;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINITB;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINITC;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINITD;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER1;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER2;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER3;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER4;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER5;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER6;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER7;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER8;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER9;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3PORTLETHUBTESTS_SPEC_23_JS_REGISTERA;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.annotations.PortletConfiguration;
-import javax.portlet.tck.beans.TestResult;
+import java.io.*;
+import java.util.*;
+import java.util.logging.*;
+import static java.util.logging.Logger.*;
+import javax.xml.namespace.QName;
+import javax.portlet.*;
+import javax.portlet.annotations.*;
+import javax.portlet.filter.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+import javax.portlet.tck.beans.*;
+import javax.portlet.tck.constants.*;
 import javax.portlet.tck.util.ModuleTestCaseDetails;
+import static javax.portlet.tck.util.ModuleTestCaseDetails.*;
+import static javax.portlet.tck.constants.Constants.*;
+import static javax.portlet.PortletSession.*;
+import static javax.portlet.ResourceURL.*;
 
 /**
  * This portlet implements several test cases for the JSR 362 TCK. The test case names
@@ -106,8 +77,7 @@ public class PortletHubTests_SPEC_23_JS implements Portlet {
       }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register2                           */
-      /* Details: "The global namespace var portlet property register is type       */
-      /* function"                                                                  */
+      /* Details: "The global portlet object register property is type function"    */
       {
          TestResult result = tcd.getTestResultFailed(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER2);
          result.writeTo(writer);
@@ -178,14 +148,14 @@ public class PortletHubTests_SPEC_23_JS implements Portlet {
       }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit1                        */
-      /* Details: "The PortletInit object portletModes property is type string"     */
+      /* Details: "The PortletInit object portletModes property is an array"     */
       {
          TestResult result = tcd.getTestResultFailed(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT1);
          result.writeTo(writer);
       }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit2                        */
-      /* Details: "The PortletInit object windowStates property is type string"     */
+      /* Details: "The PortletInit object windowStates property is an array"     */
       {
          TestResult result = tcd.getTestResultFailed(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT2);
          result.writeTo(writer);
@@ -345,6 +315,12 @@ public class PortletHubTests_SPEC_23_JS implements Portlet {
          result.writeTo(writer);
       }
 
+      writer.write("<script>");
+      writer.write("   var tck = tck || {};");
+      writer.write("   tck.PortletHubTests_SPEC_23_JS = {};");
+      writer.write("   tck.PortletHubTests_SPEC_23_JS.pid = '" + portletResp.getNamespace()
+ "';");
+      writer.write("</script>");
+
       StringBuilder txt = new StringBuilder(128);
       txt.append("<script type='text/javascript' src='");
       txt.append(portletConfig.getPortletContext().getContextPath());

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/dad32996/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/util/ModuleTestCaseDetails.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/util/ModuleTestCaseDetails.java
b/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/util/ModuleTestCaseDetails.java
index 272dcaf..a056686 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/util/ModuleTestCaseDetails.java
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/java/javax/portlet/tck/util/ModuleTestCaseDetails.java
@@ -72,7 +72,7 @@ public class ModuleTestCaseDetails extends TestCaseDetails {
    static {
 
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER1, "The portlet hub provides a global
namespace var portlet of type object");
-      tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER2, "The global namespace var portlet property
register is type function");
+      tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER2, "The global portlet object register
property is type function");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER3, "The portlet hub register function
throws an IllegalArgumentException if no portlet ID argument is provided");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER4, "The portlet hub register function
throws an IllegalArgumentException if too many (&gt;1) arguments are provided");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER5, "The portlet hub register function
throws an IllegalArgumentException if the portlet ID is not a string");
@@ -81,8 +81,8 @@ public class ModuleTestCaseDetails extends TestCaseDetails {
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER8, "The portlet hub register function
The promise fails if the portlet ID is not defined for the portlet hub");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTER9, "The portlet hub register function
does not throw an exception if the portlet ID is valid");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_REGISTERA, "The portlet hub register function
returns an object when provided with a valid portlet ID");
-      tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT1, "The PortletInit object portletModes
property is type string");
-      tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT2, "The PortletInit object windowStates
property is type string");
+      tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT1, "The PortletInit object portletModes
property is an array");
+      tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT2, "The PortletInit object windowStates
property is an array");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT3, "The PortletInit object action property
is type function");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT4, "The PortletInit object addEventListener
property is type function");
       tcd.put(V3PORTLETHUBTESTS_SPEC_23_JS_PORTLETINIT5, "The PortletInit object createResourceUrl
property is type function");

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/dad32996/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JS.js
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JS.js
b/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JS.js
index 50b462e..a32a681 100644
--- a/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JS.js
+++ b/portlet-tck_3.0/V3PortletHubTests/src/main/webapp/javascript/PortletHubTests_SPEC_23_JS.js
@@ -19,168 +19,308 @@
 
 (function() {
    'use strict';
+   var portletName = 'PortletHubTests_SPEC_23_JS';
 
-   function setSuccess (tc) {
+   function setSuccess (tc, fail) {
       var el;
       el = document.getElementById(tc + '-result');
       if (el !== null) {
-         el.innerHTML = 'Test Succeeded';
+         if (fail) {
+            el.innerHTML = fail;
+         } else {
+            el.innerHTML = 'Test Succeeded';
+         }
       }
    }
 
+   function testException (func, type) {
+      var ok = false;
+      try {
+         func();
+      } catch (e) {
+         ok = (e.name === type);
+      }
+      return ok;
+   }
+
    function execute () {
+      var update, testFunction,
+          pid = tck.PortletHubTests_SPEC_23_JS.pid;
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register1                           */
       /* Details: "The portlet hub provides a global namespace var portlet of type  */
       /* object"                                                                    */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register1');
+      if (typeof portlet === 'object') {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register1');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register2                           */
-      /* Details: "The global namespace var portlet property register is type       */
-      /* function"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register2');
+      /* Details: "The global portlet object register property is type function"    */
+      if (typeof portlet.register === 'function') {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register2');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register3                           */
       /* Details: "The portlet hub register function throws an                      */
       /* IllegalArgumentException if no portlet ID argument is provided"            */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register3');
+      testFunction = function () {
+          portlet.register();
+      }
+      if (testException(testFunction, "IllegalArgumentException")) {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register3');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register4                           */
       /* Details: "The portlet hub register function throws an                      */
       /* IllegalArgumentException if too many (&gt;1) arguments are provided"       */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register4');
+      testFunction = function () {
+          portlet.register("InvalidPortletID1", "InvalidPortletID2");
+      }
+      if (testException(testFunction, "IllegalArgumentException")) {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register4');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register5                           */
       /* Details: "The portlet hub register function throws an                      */
       /* IllegalArgumentException if the portlet ID is not a string"                */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register5');
+      testFunction = function () {
+          portlet.register(89);
+      }
+      if (testException(testFunction, "IllegalArgumentException")) {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register5');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register6                           */
       /* Details: "The portlet hub register function throws an                      */
       /* IllegalArgumentException if the portlet ID is undefined"                   */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register6');
+      testFunction = function () {
+          portlet.register(undefined);
+      }
+      if (testException(testFunction, "IllegalArgumentException")) {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register6');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register7                           */
       /* Details: "The portlet hub register function throws an                      */
       /* IllegalArgumentException if the portlet ID is null"                        */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register7');
+      testFunction = function () {
+          portlet.register(null);
+      }
+      if (testException(testFunction, "IllegalArgumentException")) {
+         setSuccess('V3PortletHubTests_SPEC_23_JS_register7');
+      }
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register8                           */
       /* Details: "The portlet hub register function The promise fails if the       */
       /* portlet ID is not defined for the portlet hub"                             */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register8');
+      try {
+    	  portlet.register("invalidPortletID").then( 
+             function (pi) {
+             }, 
+             function (err) {
+                setSuccess('V3PortletHubTests_SPEC_23_JS_register8');
+             } 
+          );
+      } catch (e) {}
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_register9                           */
       /* Details: "The portlet hub register function does not throw an exception if */
       /* the portlet ID is valid"                                                   */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_register9');
+      try {
+    	  portlet.register(pid).then( 
+             function (pi) {
+                 setSuccess('V3PortletHubTests_SPEC_23_JS_register9');
+             }, 
+             function (err) {
+             } 
+          );
+      } catch (e) {}
 
       /* TestCase: V3PortletHubTests_SPEC_23_JS_registerA                           */
       /* Details: "The portlet hub register function returns an object when         */
       /* provided with a valid portlet ID"                                          */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_registerA');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit1                        */
-      /* Details: "The PortletInit object portletModes property is type string"     */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit1');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit2                        */
-      /* Details: "The PortletInit object windowStates property is type string"     */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit2');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit3                        */
-      /* Details: "The PortletInit object action property is type function"         */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit3');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit4                        */
-      /* Details: "The PortletInit object addEventListener property is type         */
-      /* function"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit4');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit5                        */
-      /* Details: "The PortletInit object createResourceUrl property is type        */
-      /* function"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit5');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit6                        */
-      /* Details: "The PortletInit object dispatchClientEvent property is type      */
-      /* function"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit6');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit7                        */
-      /* Details: "The PortletInit object isInProgress property is type function"   */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit7');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit8                        */
-      /* Details: "The PortletInit object newParameters property is type function"  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit8');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit9                        */
-      /* Details: "The PortletInit object newState property is type function"       */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit9');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitA                        */
-      /* Details: "The PortletInit object removeEventListener property is type      */
-      /* function"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitA');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitB                        */
-      /* Details: "The PortletInit object setRenderState property is type function" */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitB');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitC                        */
-      /* Details: "The PortletInit object startPartialAction property is type       */
-      /* function"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitC');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitD                        */
-      /* Details: "The PortletInit object constants property is type object"        */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitD');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants1                          */
-      /* Details: "The Constants object VIEW property is type string and equal to   */
-      /* 'VIEW'"                                                                    */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants1');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants2                          */
-      /* Details: "The Constants object EDIT property is type string and equal to   */
-      /* 'EDIT'"                                                                    */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants2');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants3                          */
-      /* Details: "The Constants object HELP property is type string and equal to   */
-      /* 'HELP'"                                                                    */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants3');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants4                          */
-      /* Details: "The Constants object NORMAL property is type string and equal to */
-      /* 'NORMAL'"                                                                  */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants4');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants5                          */
-      /* Details: "The Constants object MINIMIZED property is type string and equal */
-      /* to 'MINIMIZED'"                                                            */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants5');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants6                          */
-      /* Details: "The Constants object MAXIMIZED property is type string and equal */
-      /* to 'MAXIMIZED'"                                                            */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants6');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants7                          */
-      /* Details: "The Constants object FULL property is type string and equal to   */
-      /* 'cacheLevelFull'"                                                          */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants7');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants8                          */
-      /* Details: "The Constants object PORTLET property is type string and equal   */
-      /* to 'cacheLevelPortlet'"                                                    */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants8');
-
-      /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants9                          */
-      /* Details: "The Constants object PAGE property is type string and equal to   */
-      /* 'cacheLevelPage'"                                                          */
-      setSuccess('V3PortletHubTests_SPEC_23_JS_Constants9');
+      try {
+    	  portlet.register(pid).then( 
+    	     function (pi) {
+    	    	 if (typeof pi === 'object') {
+    	    		 setSuccess('V3PortletHubTests_SPEC_23_JS_registerA');
+    	    	 }
+    	     }, 
+    	     function (err) {
+    	     } 
+          );
+      } catch (e) {}
+
+      update = function (type, state) {
+      }
+
+      portlet.register(pid).then(function (hub) {
+
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit1                        */
+         /* Details: "The PortletInit object portletModes property is an array"     */
+         if (Array.isArray(hub.portletModes)) {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit1');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit2                        */
+         /* Details: "The PortletInit object windowStates property is an array"     */
+         if (Array.isArray(hub.windowStates)) {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit2');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit3                        */
+         /* Details: "The PortletInit object action property is type function"         */
+         if (typeof hub.action === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit3');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit4                        */
+         /* Details: "The PortletInit object addEventListener property is type         */
+         /* function"                                                                  */
+         if (typeof hub.addEventListener === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit4');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit5                        */
+         /* Details: "The PortletInit object createResourceUrl property is type        */
+         /* function"                                                                  */
+         if (typeof hub.createResourceUrl === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit5');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit6                        */
+         /* Details: "The PortletInit object dispatchClientEvent property is type      */
+         /* function"                                                                  */
+         if (typeof hub.dispatchClientEvent === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit6');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit7                        */
+         /* Details: "The PortletInit object isInProgress property is type function"   */
+         if (typeof hub.isInProgress === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit7');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit8                        */
+         /* Details: "The PortletInit object newParameters property is type function"  */
+         if (typeof hub.newParameters === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit8');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInit9                        */
+         /* Details: "The PortletInit object newState property is type function"       */
+         if (typeof hub.newState === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInit9');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitA                        */
+         /* Details: "The PortletInit object removeEventListener property is type      */
+         /* function"                                                                  */
+         if (typeof hub.removeEventListener === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitA');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitB                        */
+         /* Details: "The PortletInit object setRenderState property is type function" */
+         if (typeof hub.setRenderState === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitB');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitC                        */
+         /* Details: "The PortletInit object startPartialAction property is type       */
+         /* function"                                                                  */
+         if (typeof hub.startPartialAction === 'function') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitC');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_PortletInitD                        */
+         /* Details: "The PortletInit object constants property is type object"        */
+         if (typeof hub.constants === 'object') {
+            setSuccess('V3PortletHubTests_SPEC_23_JS_PortletInitD');
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants1                          */
+         /* Details: "The Constants object VIEW property is type string and equal to   */
+         /* 'VIEW'"                                                                    */
+         if (typeof hub.constants.VIEW === 'string') {
+            if (hub.constants.VIEW === 'VIEW') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants1');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants2                          */
+         /* Details: "The Constants object EDIT property is type string and equal to   */
+         /* 'EDIT'"                                                                    */
+         if (typeof hub.constants.EDIT === 'string') {
+            if (hub.constants.EDIT === 'EDIT') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants2');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants3                          */
+         /* Details: "The Constants object HELP property is type string and equal to   */
+         /* 'HELP'"                                                                    */
+         if (typeof hub.constants.HELP === 'string') {
+            if (hub.constants.HELP === 'HELP') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants3');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants4                          */
+         /* Details: "The Constants object NORMAL property is type string and equal to */
+         /* 'NORMAL'"                                                                  */
+         if (typeof hub.constants.NORMAL === 'string') {
+            if (hub.constants.NORMAL === 'NORMAL') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants4');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants5                          */
+         /* Details: "The Constants object MINIMIZED property is type string and equal */
+         /* to 'MINIMIZED'"                                                            */
+         if (typeof hub.constants.MINIMIZED === 'string') {
+            if (hub.constants.MINIMIZED === 'MINIMIZED') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants5');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants6                          */
+         /* Details: "The Constants object MAXIMIZED property is type string and equal */
+         /* to 'MAXIMIZED'"                                                            */
+         if (typeof hub.constants.MAXIMIZED === 'string') {
+            if (hub.constants.MAXIMIZED === 'MAXIMIZED') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants6');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants7                          */
+         /* Details: "The Constants object FULL property is type string and equal to   */
+         /* 'cacheLevelFull'"                                                          */
+         if (typeof hub.constants.FULL === 'string') {
+            if (hub.constants.FULL === 'cacheLevelFull') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants7');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants8                          */
+         /* Details: "The Constants object PORTLET property is type string and equal   */
+         /* to 'cacheLevelPortlet'"                                                    */
+         if (typeof hub.constants.PORTLET === 'string') {
+            if (hub.constants.PORTLET === 'cacheLevelPortlet') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants8');
+            }
+         }
+         
+         /* TestCase: V3PortletHubTests_SPEC_23_JS_Constants9                          */
+         /* Details: "The Constants object PAGE property is type string and equal to   */
+         /* 'cacheLevelPage'"                                                          */
+         if (typeof hub.constants.PAGE === 'string') {
+            if (hub.constants.PAGE === 'cacheLevelPage') {
+              setSuccess('V3PortletHubTests_SPEC_23_JS_Constants9');
+            }
+         }
+
+      });
    }
 
    window.addEventListener('load', execute);


Mime
View raw message