portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [06/17] portals-pluto git commit: Implemented all tests of V2AddlPortletTests module.
Date Thu, 09 Jun 2016 06:39:13 GMT
Implemented all tests of V2AddlPortletTests module.


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

Branch: refs/heads/master
Commit: d2605cdafb96bcd117123977be40090a9473949f
Parents: 535f92d
Author: ahmed <mahmedk91@gmail.com>
Authored: Fri Jun 3 14:31:57 2016 +0200
Committer: ahmed <mahmedk91@gmail.com>
Committed: Fri Jun 3 14:31:57 2016 +0200

----------------------------------------------------------------------
 portlet-tck_3.0/V2AddlPortletTests/pom.xml      |    1 +
 ...dlPortletTests_SPEC2_13_ResourceServing.java |  471 ++++---
 ...tletTests_SPEC2_13_ResourceServingCache.java | 1270 +++++++++++++-----
 ...rtletTests_SPEC2_15_ActionEventHandling.java |  289 ----
 .../AddlPortletTests_SPEC2_15_Event.java        |  137 +-
 ...ortletTests_SPEC2_15_EventEventHandling.java |  553 ++++----
 ...Tests_SPEC2_15_EventEventHandling_event.java |  482 ++++---
 ...EventEventHandling_unavailableException.java |   77 ++
 .../AddlPortletTests_SPEC2_15_Event_event.java  |  144 +-
 ...rtletTests_SPEC2_15_RenderEventHandling.java |  129 --
 .../AddlPortletTests_SPEC2_2_Compatibility.java |   41 +-
 ...AddlPortletTests_SPEC2_5_ActionHandling.java |  318 ++---
 ...rtletTests_SPEC2_5_ActionHandling_event.java |  171 +++
 .../AddlPortletTests_SPEC2_5_EventHandling.java |  189 ++-
 ...ortletTests_SPEC2_5_EventHandling_event.java |  116 +-
 ...AddlPortletTests_SPEC2_5_Initialization.java |  173 ++-
 ...rtletTests_SPEC2_5_RenderGenericPortlet.java |  252 ++--
 ...ests_SPEC2_5_RenderGenericPortlet_event.java |  116 ++
 ...AddlPortletTests_SPEC2_5_RenderHandling.java |  114 --
 ...dlPortletTests_SPEC2_5_ResourceHandling.java |  200 ++-
 .../AddlPortletTests_SPEC2_6_RenderConfig.java  |  467 ++++---
 .../AddlPortletTests_SPEC2_6_RenderConfig2.java |  217 ++-
 .../AddlPortletTests_SPEC2_6_RenderConfig3.java |  223 ++-
 .../AddlPortletTests_SPEC2_8_PortletModes.java  |  151 ++-
 .../AddlPortletTests_SPEC2_9_WindowStates.java  |  295 ++--
 ...s_SPEC2_15_EventEventHandling_eventData.java |   41 +
 .../portlet-mode-resource_en_US.properties      |    5 +
 .../portlets/resource-no-title_en_US.properties |    3 +
 .../tck/portlets/resource_en_US.properties      |    6 +
 .../resources/xml-resources/additionalTCs.xml   |   25 -
 .../src/main/webapp/WEB-INF/portlet.xml         |  818 ++++++-----
 31 files changed, 4046 insertions(+), 3448 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d2605cda/portlet-tck_3.0/V2AddlPortletTests/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlPortletTests/pom.xml b/portlet-tck_3.0/V2AddlPortletTests/pom.xml
index b9f164b..851c0af 100644
--- a/portlet-tck_3.0/V2AddlPortletTests/pom.xml
+++ b/portlet-tck_3.0/V2AddlPortletTests/pom.xml
@@ -33,6 +33,7 @@
       <dependency>
          <groupId>javax.portlet</groupId>
          <artifactId>portlet-api</artifactId>
+         <version>2.0</version>
       </dependency>
       <dependency>
          <groupId>javax.servlet</groupId>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/d2605cda/portlet-tck_3.0/V2AddlPortletTests/src/main/java/javax/portlet/tck/portlets/AddlPortletTests_SPEC2_13_ResourceServing.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlPortletTests/src/main/java/javax/portlet/tck/portlets/AddlPortletTests_SPEC2_13_ResourceServing.java
b/portlet-tck_3.0/V2AddlPortletTests/src/main/java/javax/portlet/tck/portlets/AddlPortletTests_SPEC2_13_ResourceServing.java
index 480ca98..a9448b9 100644
--- a/portlet-tck_3.0/V2AddlPortletTests/src/main/java/javax/portlet/tck/portlets/AddlPortletTests_SPEC2_13_ResourceServing.java
+++ b/portlet-tck_3.0/V2AddlPortletTests/src/main/java/javax/portlet/tck/portlets/AddlPortletTests_SPEC2_13_ResourceServing.java
@@ -1,19 +1,16 @@
-/*  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
+/*
+ * 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
+ * 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.
+ * 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.
  */
 
 package javax.portlet.tck.portlets;
@@ -21,161 +18,313 @@ package javax.portlet.tck.portlets;
 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.filter.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
 import javax.portlet.tck.beans.*;
-import javax.portlet.tck.constants.*;
 import static javax.portlet.tck.beans.JSR286SpecTestCaseDetails.*;
 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
- * are defined in the /src/main/resources/xml-resources/additionalTCs.xml
- * file. The build process will integrate the test case names defined in the 
- * additionalTCs.xml file into the complete list of test case names for execution by the
driver.
- *
- * This is the main portlet for the test cases. If the test cases call for events, this portlet
- * will initiate the events, but not process them. The processing is done in the companion

- * portlet AddlPortletTests_SPEC2_13_ResourceServing_event
+ * This portlet implements several test cases for the JSR 362 TCK. The test case names are
defined
+ * in the /src/main/resources/xml-resources/additionalTCs.xml file. The build process will
integrate
+ * the test case names defined in the additionalTCs.xml file into the complete list of test
case
+ * names for execution by the driver.
  *
+ * This is the main portlet for the test cases. If the test cases call for events, this portlet
will
+ * initiate the events, but not process them. The processing is done in the companion portlet
+ * AddlPortletTests_SPEC2_13_ResourceServing_event
+ * @author ahmed
  */
 public class AddlPortletTests_SPEC2_13_ResourceServing implements Portlet, ResourceServingPortlet
{
-   private static final String LOG_CLASS = 
-         AddlPortletTests_SPEC2_13_ResourceServing.class.getName();
-   private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
-   
-   private PortletConfig portletConfig = null;
-
-   @Override
-   public void init(PortletConfig config) throws PortletException {
-      this.portletConfig = config;
-   }
-
-   @Override
-   public void destroy() {
-   }
-
-   @Override
-   public void processAction(ActionRequest portletReq, ActionResponse portletResp)
-         throws PortletException, IOException {
-      LOGGER.entering(LOG_CLASS, "main portlet processAction entry");
-
-      portletResp.setRenderParameters(portletReq.getParameterMap());
-      long tid = Thread.currentThread().getId();
-      portletReq.setAttribute(THREADID_ATTR, tid);
-
-      StringWriter writer = new StringWriter();
-
-   }
-
-   @Override
-   public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp)
-         throws PortletException, IOException {
-      LOGGER.entering(LOG_CLASS, "main portlet serveResource entry");
-
-      long tid = Thread.currentThread().getId();
-      portletReq.setAttribute(THREADID_ATTR, tid);
-
-      PrintWriter writer = portletResp.getWriter();
-
-      JSR286SpecTestCaseDetails tcd = new JSR286SpecTestCaseDetails();
-
-      // Create result objects for the tests
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs2  */
-      /* Details: "When a resource URL is invoked, the portlet container      */
-      /* must not call the processAction method"                              */
-      TestResult tr0 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS2);
-      /* TODO: implement test */
-      tr0.appendTcDetail("Not implemented.");
-      tr0.writeTo(writer);
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs4  */
-      /* Details: "After a resource URL has been created, the portlet mode    */
-      /* set on the resource URL cannot be changed"                           */
-      TestResult tr1 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS4);
-      /* TODO: implement test */
-      tr1.appendTcDetail("Not implemented.");
-      tr1.writeTo(writer);
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs5  */
-      /* Details: "After a resource URL has been created, the window state    */
-      /* set on the resource URL cannot be changed"                           */
-      TestResult tr2 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS5);
-      /* TODO: implement test */
-      tr2.appendTcDetail("Not implemented.");
-      tr2.writeTo(writer);
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs6  */
-      /* Details: "After a resource URL has been created, the render          */
-      /* parameters set on the resource URL cannot be changed"                */
-      TestResult tr3 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS6);
-      /* TODO: implement test */
-      tr3.appendTcDetail("Not implemented.");
-      tr3.writeTo(writer);
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs7  */
-      /* Details: "After a resource URL has been created, a parameter set     */
-      /* on the resource URL is a resource parameter, not a render            */
-      /* parameter"                                                           */
-      TestResult tr4 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS7);
-      /* TODO: implement test */
-      tr4.appendTcDetail("Not implemented.");
-      tr4.writeTo(writer);
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs8  */
-      /* Details: "After a resource URL has been created, a parameter set     */
-      /* on the URL with the same name as an exsisting render parameter       */
-      /* results in a multivalued parameter containing both the resource      */
-      /* pramaeter values and the render parameter values"                    */
-      TestResult tr5 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS8);
-      /* TODO: implement test */
-      tr5.appendTcDetail("Not implemented.");
-      tr5.writeTo(writer);
-
-      /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs9  */
-      /* Details: "In the resulting multivalued parameter after a resource    */
-      /* parameter is added with the same name as a render parameter, the     */
-      /* the render parameter values must be the last entries in the          */
-      /* parameter value array"                                               */
-      TestResult tr6 = tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS9);
-      /* TODO: implement test */
-      tr6.appendTcDetail("Not implemented.");
-      tr6.writeTo(writer);
-
-   }
-
-   @Override
-   public void render(RenderRequest portletReq, RenderResponse portletResp)
-         throws PortletException, IOException {
-      LOGGER.entering(LOG_CLASS, "main portlet render entry");
-
-      long tid = Thread.currentThread().getId();
-      portletReq.setAttribute(THREADID_ATTR, tid);
-
-      PrintWriter writer = portletResp.getWriter();
-
-      writer.write("<div id=\"AddlPortletTests_SPEC2_13_ResourceServing\">no resource
output.</div>\n");
-      ResourceURL resurl = portletResp.createResourceURL();
-      resurl.setCacheability(PAGE);
-      writer.write("<script>\n");
-      writer.write("(function () {\n");
-      writer.write("   var xhr = new XMLHttpRequest();\n");
-      writer.write("   xhr.onreadystatechange=function() {\n");
-      writer.write("      if (xhr.readyState==4 && xhr.status==200) {\n");
-      writer.write("         document.getElementById(\"AddlPortletTests_SPEC2_13_ResourceServing\").innerHTML=xhr.responseText;\n");
-      writer.write("      }\n");
-      writer.write("   };\n");
-      writer.write("   xhr.open(\"GET\",\"" + resurl.toString() + "\",true);\n");
-      writer.write("   xhr.send();\n");
-      writer.write("})();\n");
-      writer.write("</script>\n");
-   }
+  private static final String LOG_CLASS = AddlPortletTests_SPEC2_13_ResourceServing.class.getName();
+  private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
+
+  private boolean tr0_action = false;
+
+  @Override
+  public void init(PortletConfig config) throws PortletException {}
+
+  @Override
+  public void destroy() {}
+
+  @Override
+  public void processAction(ActionRequest portletReq, ActionResponse portletResp)
+      throws PortletException, IOException {
+    LOGGER.entering(LOG_CLASS, "main portlet processAction entry");
+    portletResp.setRenderParameters(portletReq.getParameterMap());
+    long tid = Thread.currentThread().getId();
+    portletReq.setAttribute(THREADID_ATTR, tid);
+    tr0_action = true;
+  }
+
+  @Override
+  public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp)
+      throws PortletException, IOException {
+    LOGGER.entering(LOG_CLASS, "main portlet serveResource entry");
+    JSR286SpecTestCaseDetails tcd = new JSR286SpecTestCaseDetails();
+    long tid = Thread.currentThread().getId();
+    portletReq.setAttribute(THREADID_ATTR, tid);
+
+    PrintWriter writer = portletResp.getWriter();
+
+    String action = portletReq.getParameter("action");
+
+    if (action != null) {
+      if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs2")) {
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs2 */
+        /* Details: "When a resource URL is invoked, the portlet container */
+        /* must not call the processAction method" */
+        TestResult tr0 =
+            tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS2);
+        if (!tr0_action) {
+          tr0.setTcSuccess(true);
+        } else {
+          tr0.appendTcDetail("Failed because processAction method called by resourceURL");
+        }
+        tr0.writeTo(writer);
+      } else if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs4"))
{
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs4 */
+        /* Details: "After a resource URL has been created, the portlet mode */
+        /* set on the resource URL cannot be changed" */
+        TestResult tr1 =
+            tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS4);
+        tr1.setTcSuccess(true);
+        tr1.appendTcDetail("No method to change portlet mode in ResourceResponse. Current
mode is "
+            + portletReq.getPortletMode());
+        tr1.writeTo(writer);
+      } else if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs5"))
{
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs5 */
+        /* Details: "After a resource URL has been created, the window state */
+        /* set on the resource URL cannot be changed" */
+        TestResult tr2 =
+            tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS5);
+        tr2.setTcSuccess(true);
+        tr2.appendTcDetail("No method to change window state in ResourceResponse. Current
state is "
+            + portletReq.getWindowState());
+        tr2.writeTo(writer);
+      } else if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs6"))
{
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs6 */
+        /* Details: "After a resource URL has been created, the render */
+        /* parameters set on the resource URL cannot be changed" */
+        TestResult tr3 =
+            tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS6);
+        if (portletReq.getParameter("tr3") != null
+            && portletReq.getParameter("tr3").equals("true")) {
+          tr3.setTcSuccess(true);
+          tr3.appendTcDetail("No method to modify render parameter in ResourceResponse");
+        } else {
+          tr3.appendTcDetail("Failed - did not recieve render parameter tr3");
+        }
+        tr3.writeTo(writer);
+      } else if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs7"))
{
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs7 */
+        /* Details: "After a resource URL has been created, a parameter set */
+        /* on the resource URL is a resource parameter, not a render */
+        /* parameter" */
+        TestResult tr4 =
+            tcd.getTestResultSucceeded(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS7);
+        if (portletReq.getParameter("tr4_resource") != null
+            && portletReq.getParameter("tr4_resource").equals("true")) {
+          Map<String, String[]> map = portletReq.getPrivateRenderParameterMap();
+          for (Entry<String, String[]> entry : map.entrySet()) {
+            String[] values = entry.getValue();
+            for (String e : values) {
+              if (entry.getKey().equals("tr4_resource") && e.equals("true")) {
+                tr4.setTcSuccess(false);
+                tr4.appendTcDetail("\"tr4\" is present as render parameter in ResourceRequest");
+              }
+            }
+          }
+        } else {
+          tr4.appendTcDetail(
+              "\"tr4_resource\" parameter is not present as resource parameter in ResourceRequest");
+        }
+        tr4.writeTo(writer);
+      } else if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs8"))
{
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs8 */
+        /* Details: "After a resource URL has been created, a parameter set */
+        /* on the URL with the same name as an existing render parameter */
+        /* results in a multivalued parameter containing both the resource */
+        /* parameter values and the render parameter values" */
+        TestResult tr5 =
+            tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS8);
+        if (portletReq.getParameterValues("tr5") != null
+            && portletReq.getParameterValues("tr5").length == 2) {
+          tr5.setTcSuccess(true);
+        } else {
+          tr5.appendTcDetail(
+              "Failed because both resource parameter and the render parameter is not present");
+        }
+        tr5.writeTo(writer);
+      } else if (action.equals("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs9"))
{
+        /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs9 */
+        /* Details: "In the resulting multivalued parameter after a resource */
+        /* parameter is added with the same name as a render parameter, the */
+        /* the render parameter values must be the last entries in the */
+        /* parameter value array" */
+        TestResult tr6 =
+            tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_13_RESOURCESERVING_RESOURCEURLS9);
+        String tr6_value[] = portletReq.getParameterValues("tr6");
+        if (tr6_value != null && tr6_value.length == 2 && tr6_value[0].equals("false")
+            && tr6_value[1].equals("true")) {
+          tr6.setTcSuccess(true);
+        } else {
+          tr6.appendTcDetail("Failed because render parameter value is not last.");
+        }
+        tr6.writeTo(writer);
+      }
+    }
+  }
+
+  @Override
+  public void render(RenderRequest portletReq, RenderResponse portletResp)
+      throws PortletException, IOException {
+    LOGGER.entering(LOG_CLASS, "main portlet render entry");
+
+    long tid = Thread.currentThread().getId();
+    portletReq.setAttribute(THREADID_ATTR, tid);
+
+    PrintWriter writer = portletResp.getWriter();
+
+    writer.write("<script type=\"text/javascript\" id=\"getResourceCall\">");
+    writer.write("  function getResource(testCase, URL) {");
+    writer.write("    var xhr = new XMLHttpRequest();");
+    writer.write("    xhr.onreadystatechange=function() {");
+    writer.write("      if (xhr.readyState==4 && xhr.status==200) {");
+    writer.write("        document.getElementById(testCase).innerHTML = xhr.responseText;");
+    writer.write("      }");
+    writer.write("    };");
+    writer.write("    xhr.open(\"POST\",URL,true);");
+    writer.write("    xhr.send();");
+    writer.write("  }");
+    writer.write("</script>");
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs2 */
+    /* Details: "When a resource URL is invoked, the portlet container */
+    /* must not call the processAction method" */
+    {
+      ResourceURL resurlTr0 = portletResp.createResourceURL();
+      resurlTr0.setParameter("action", "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs2");
+      writer.write("<DIV id=\"tr0_ResourceServing\"></DIV>");
+      writer.write("<script type=\"text/javascript\">");
+      writer.write("getResource('tr0_ResourceServing','" + resurlTr0.toString() + "');");
+      writer.write("</script>");
+    }
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs4 */
+    /* Details: "After a resource URL has been created, the portlet mode */
+    /* set on the resource URL cannot be changed" */
+    {
+      ResourceURL resurlTr1 = portletResp.createResourceURL();
+      resurlTr1.setParameter("action", "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs4");
+      writer.write("<DIV id=\"tr1_ResourceServing\"></DIV>");
+      writer.write("<script type=\"text/javascript\">");
+      writer.write("getResource('tr1_ResourceServing','" + resurlTr1.toString() + "');");
+      writer.write("</script>");
+    }
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs5 */
+    /* Details: "After a resource URL has been created, the window state */
+    /* set on the resource URL cannot be changed" */
+    {
+      ResourceURL resurlTr2 = portletResp.createResourceURL();
+      resurlTr2.setParameter("action", "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs5");
+      writer.write("<DIV id=\"tr2_ResourceServing\"></DIV>");
+      writer.write("<script type=\"text/javascript\">");
+      writer.write("getResource('tr2_ResourceServing','" + resurlTr2.toString() + "');");
+      writer.write("</script>");
+    }
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs6 */
+    /* Details: "After a resource URL has been created, the render */
+    /* parameters set on the resource URL cannot be changed" */
+    {
+      if (portletReq.getParameter("tr3") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tr3", "true");
+        TestLink tl =
+            new TestLink("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs6", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr3 = portletResp.createResourceURL();
+        resurlTr3.setParameter("action",
+            "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs6");
+        writer.write("<DIV id=\"tr3_ResourceServing\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr3_ResourceServing','" + resurlTr3.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs7 */
+    /* Details: "After a resource URL has been created, a parameter set */
+    /* on the resource URL is a resource parameter, not a render */
+    /* parameter" */
+    {
+      if (portletReq.getParameter("tr4") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tr4", "true");
+        TestLink tl =
+            new TestLink("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs7", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr4 = portletResp.createResourceURL();
+        resurlTr4.setParameter("tr4_resource", "true");
+        resurlTr4.setParameter("action",
+            "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs7");
+        writer.write("<DIV id=\"tr4_ResourceServing\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr4_ResourceServing','" + resurlTr4.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs8 */
+    /* Details: "After a resource URL has been created, a parameter set */
+    /* on the URL with the same name as an existing render parameter */
+    /* results in a multivalued parameter containing both the resource */
+    /* parameter values and the render parameter values" */
+    {
+      if (portletReq.getParameter("tr5") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tr5", "true");
+        TestLink tl =
+            new TestLink("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs8", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr5 = portletResp.createResourceURL();
+        resurlTr5.setParameter("tr5", "false");
+        resurlTr5.setParameter("action",
+            "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs8");
+        writer.write("<DIV id=\"tr5_ResourceServing\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr5_ResourceServing','" + resurlTr5.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+
+    /* TestCase: V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs9 */
+    /* Details: "In the resulting multivalued parameter after a resource */
+    /* parameter is added with the same name as a render parameter, the */
+    /* the render parameter values must be the last entries in the */
+    /* parameter value array" */
+    {
+      if (portletReq.getParameter("tr6") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tr6", "true");
+        TestLink tl =
+            new TestLink("V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs9", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr6 = portletResp.createResourceURL();
+        resurlTr6.setParameter("tr6", "false");
+        resurlTr6.setParameter("action",
+            "V2AddlPortletTests_SPEC2_13_ResourceServing_resourceURLs9");
+        writer.write("<DIV id=\"tr6_ResourceServing\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr6_ResourceServing','" + resurlTr6.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+  }
 
 }


Mime
View raw message