portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [10/17] portals-pluto git commit: Implemented all tests of V2AddlRequestTests module.
Date Thu, 09 Jun 2016 06:39:17 GMT
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0749f2a8/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_Resource.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_Resource.java b/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_Resource.java
index c0feeea..2298489 100644
--- a/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_Resource.java
+++ b/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_Resource.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,170 +18,327 @@ 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 AddlRequestTests_SPEC2_11_Resource_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
+ * AddlRequestTests_SPEC2_11_Resource_event
+ * @author ahmed
  */
 public class AddlRequestTests_SPEC2_11_Resource implements Portlet, ResourceServingPortlet {
-   private static final String LOG_CLASS = 
-         AddlRequestTests_SPEC2_11_Resource.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: V2AddlRequestTests_SPEC2_11_Resource_parameters1           */
-      /* Details: "If a portlet receives a request from a client request      */
-      /* targeted to the portlet itself, the parameters must be the string    */
-      /* parameters encoded in the URL (added when creating the PortletURL)   */
-      /* and the string parameters sent by the client to the portlet as       */
-      /* part of the client request"                                          */
-      TestResult tr0 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PARAMETERS1);
-      /* TODO: implement test */
-      tr0.appendTcDetail("Not implemented.");
-      tr0.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters2           */
-      /* Details: "The parameters the request object returns must be          */
-      /* \"x-www-form-urlencoded\" decoded"                                   */
-      TestResult tr1 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PARAMETERS2);
-      /* TODO: implement test */
-      tr1.appendTcDetail("Not implemented.");
-      tr1.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters6           */
-      /* Details: "The getParameterMap method must return an unmodifiable     */
-      /* Map object"                                                          */
-      TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PARAMETERS6);
-      /* TODO: implement test */
-      tr2.appendTcDetail("Not implemented.");
-      tr2.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters17          */
-      /* Details: "If the cacheability level of the resource URL is PORTLET   */
-      /* or PAGE, the portlet must also receive the render parameters         */
-      /* present in the request in which the URL was created"                 */
-      TestResult tr3 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PARAMETERS17);
-      /* TODO: implement test */
-      tr3.appendTcDetail("Not implemented.");
-      tr3.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters15 */
-      /* Details: "A map of private parameters can be obtained through the    */
-      /* getPrivateParameterMap method"                                       */
-      TestResult tr4 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PUBLICRENDERPARAMETERS15);
-      /* TODO: implement test */
-      tr4.appendTcDetail("Not implemented.");
-      tr4.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16 */
-      /* Details: "A map of public parameters can be obtained through the     */
-      /* getPublicParameterMap method"                                        */
-      TestResult tr5 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PUBLICRENDERPARAMETERS16);
-      /* TODO: implement test */
-      tr5.appendTcDetail("Not implemented.");
-      tr5.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7 */
-      /* Details: "Public render parameters are available in the              */
-      /* serveResource method"                                                */
-      TestResult tr6 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PUBLICRENDERPARAMETERS7);
-      /* TODO: implement test */
-      tr6.appendTcDetail("Not implemented.");
-      tr6.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12 */
-      /* Details: "If the portlet sets a resource parameter with the same     */
-      /* name as a public render parameter, this results in a multi-valued    */
-      /* parameter. The public render parameter values must be the last       */
-      /* entries in the parameter value array"                                */
-      TestResult tr7 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PUBLICRENDERPARAMETERS12);
-      /* TODO: implement test */
-      tr7.appendTcDetail("Not implemented.");
-      tr7.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=\"AddlRequestTests_SPEC2_11_Resource\">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(\"AddlRequestTests_SPEC2_11_Resource\").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 = AddlRequestTests_SPEC2_11_Resource.class.getName();
+  private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
+
+  @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);
+
+  }
+
+  @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
+
+    String action = portletReq.getParameter("action");
+    if (action != null) {
+      if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_parameters2")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters2 */
+        /* Details: "The parameters the request object returns must be */
+        /* \"x-www-form-urlencoded\" decoded" */
+        TestResult tr1 =
+            tcd.getTestResultFailed("V2AddlRequestTests_SPEC2_11_Resource_parameters2");
+        if (portletReq.getParameter("tr1") != null
+            && portletReq.getParameter("tr1").equals("true&<>\"'")) {
+          tr1.setTcSuccess(true);
+        } else {
+          tr1.appendTcDetail("tr1 paramater value:true&<>\"' is not decoded properly");
+        }
+        tr1.writeTo(writer);
+      } else if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_parameters6")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters6 */
+        /* Details: "The getParameterMap method must return an unmodifiable */
+        /* Map object" */
+        TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCE_PARAMETERS6);
+        if (portletReq.getParameterMap().containsKey("action")
+            && "V2AddlRequestTests_SPEC2_11_Resource_parameters6"
+                .equals(portletReq.getParameterMap().get("action")[0])) {
+          String tr2TestStringArray[] = {"Modified Value"};
+          portletReq.getParameterMap().put("action", tr2TestStringArray);
+          if ("V2AddlRequestTests_SPEC2_11_Resource_parameters6"
+              .equals(portletReq.getParameterMap().get("action")[0])) {
+            tr2.setTcSuccess(true);
+          }
+        }
+        tr2.writeTo(writer);
+      } else if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_parameters17")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters17 */
+        /* Details: "If the cacheability level of the resource URL is PORTLET */
+        /* or PAGE, the portlet must also receive the render parameters */
+        /* present in the request in which the URL was created" */
+        TestResult tr3 =
+            tcd.getTestResultFailed("V2AddlRequestTests_SPEC2_11_Resource_parameters17");
+        if (portletReq.getParameter("tr3") != null
+            && portletReq.getParameter("tr3").equals("true")) {
+          tr3.setTcSuccess(true);
+        } else {
+          tr3.appendTcDetail(
+              "Render parameter tr3 is not included in resourceURL after setting cacheability level to PORTLET");
+        }
+        tr3.writeTo(writer);
+      } else if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters15")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters15 */
+        /* Details: "A map of private parameters can be obtained through the */
+        /* getPrivateParameterMap method" */
+        TestResult tr4 = tcd
+            .getTestResultFailed("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters15");
+        Map<String, String[]> privateParamMap = portletReq.getPrivateParameterMap();
+        if (privateParamMap != null && privateParamMap.containsKey("tr4")
+            && privateParamMap.get("tr4")[0].equals("true")) {
+          tr4.setTcSuccess(true);
+        }
+        tr4.writeTo(writer);
+      } else if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16 */
+        /* Details: "A map of public parameters can be obtained through the */
+        /* getPublicParameterMap method" */
+        /*
+         * TODO: getPublicParameterMap() not working. See -
+         * V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12 The public render parameter
+         * is accessible with getParameterValues("tckPRP4")
+         */
+        TestResult tr5 = tcd
+            .getTestResultFailed("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16");
+        if (portletReq.getPublicParameterMap() != null
+            && portletReq.getPublicParameterMap().containsKey("tckPRP4")) {
+          tr5.setTcSuccess(true);
+        } else {
+          tr5.appendTcDetail("No public render parameter found.");
+        }
+        tr5.writeTo(writer);
+      } else if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7 */
+        /* Details: "Public render parameters are available in the */
+        /* serveResource method" */
+        /*
+         * TODO: getPublicParameterMap() not working. See -
+         * V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12 The public render parameter
+         * is accessible with getParameterValues("tckPRP4")
+         */
+        TestResult tr6 =
+            tcd.getTestResultFailed("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7");
+        Map<String, String[]> publicParamMapTr6 = portletReq.getPublicParameterMap();
+        if (publicParamMapTr6 != null && publicParamMapTr6.containsKey("tckPRP4")
+            && publicParamMapTr6.get("tckPRP4")[0].equals("true")) {
+          tr6.setTcSuccess(true);
+        } else {
+          tr6.appendTcDetail("Render parameter tckPRP4 is not found or is not equal to \"true\".");
+        }
+        tr6.writeTo(writer);
+      } else if (action.equals("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12")) {
+        /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12 */
+        /* Details: "If the portlet sets a resource parameter with the same */
+        /* name as a public render parameter, this results in a multi-valued */
+        /* parameter. The public render parameter values must be the last */
+        /* entries in the parameter value array" */
+        TestResult tr7 = tcd
+            .getTestResultFailed("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12");
+        String[] mergedParamsTr7 = portletReq.getParameterValues("tckPRP4");
+        if (mergedParamsTr7 != null && mergedParamsTr7.length == 2
+            && mergedParamsTr7[0].equals("false") && mergedParamsTr7[1].equals("true")) {
+          tr7.setTcSuccess(true);
+        } else {
+          tr7.appendTcDetail(
+              "Render parameter tckPRP4 is not found or is not equal {\"false\",\"true\"}.");
+        }
+        tr7.writeTo(writer);
+      } else {
+        writer.write("\"action\" parameter value did not match the name of test case");
+      }
+    } else {
+      writer.write("No \"action\" parameter was found in resourceURL");
+    }
+  }
+
+  @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: V2AddlRequestTests_SPEC2_11_Resource_parameters2 */
+    /* Details: "The parameters the request object returns must be */
+    /* \"x-www-form-urlencoded\" decoded" */
+    {
+      ResourceURL resurlTr1 = portletResp.createResourceURL();
+      resurlTr1.setParameter("action", "V2AddlRequestTests_SPEC2_11_Resource_parameters2");
+      resurlTr1.setParameter("tr1", "true&<>\"'");
+      writer.write("<DIV id=\"tr1\"></DIV>");
+      writer.write("<script type=\"text/javascript\">");
+      writer.write("getResource('tr1','" + resurlTr1.toString() + "');");
+      writer.write("</script>");
+    }
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters6 */
+    /* Details: "The getParameterMap method must return an unmodifiable */
+    /* Map object" */
+    {
+      ResourceURL resurlTr2 = portletResp.createResourceURL();
+      resurlTr2.setParameter("action", "V2AddlRequestTests_SPEC2_11_Resource_parameters6");
+      writer.write("<DIV id=\"tr2\"></DIV>");
+      writer.write("<script type=\"text/javascript\">");
+      writer.write("getResource('tr2','" + resurlTr2.toString() + "');");
+      writer.write("</script>");
+    }
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_parameters17 */
+    /* Details: "If the cacheability level of the resource URL is PORTLET */
+    /* or PAGE, the portlet must also receive the render parameters */
+    /* present in the request in which the URL was created" */
+    {
+      if (portletReq.getParameter("tr3") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tr3", "true");
+        TestLink tl = new TestLink("V2AddlRequestTests_SPEC2_11_Resource_parameters17", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr3 = portletResp.createResourceURL();
+        resurlTr3.setCacheability(PORTLET);
+        resurlTr3.setParameter("action", "V2AddlRequestTests_SPEC2_11_Resource_parameters17");
+        writer.write("<DIV id=\"tr3\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr3','" + resurlTr3.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters15 */
+    /* Details: "A map of private parameters can be obtained through the */
+    /* getPrivateParameterMap method" */
+    {
+      ResourceURL resurlTr4 = portletResp.createResourceURL();
+      resurlTr4.setParameter("action",
+          "V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters15");
+      resurlTr4.setParameter("tr4", "true");
+      writer.write("<DIV id=\"tr4\"></DIV>");
+      writer.write("<script type=\"text/javascript\">");
+      writer.write("getResource('tr4','" + resurlTr4.toString() + "');");
+      writer.write("</script>");
+    }
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16 */
+    /* Details: "A map of public parameters can be obtained through the */
+    /* getPublicParameterMap method" */
+    {
+      if (portletReq.getParameter("tckPRP4") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tckPRP4", "true");
+        TestLink tl =
+            new TestLink("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr5 = portletResp.createResourceURL();
+        resurlTr5.setParameter("action",
+            "V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16");
+        writer.write("<DIV id=\"tr5\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr5','" + resurlTr5.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7 */
+    /* Details: "Public render parameters are available in the */
+    /* serveResource method" */
+    {
+      if (portletReq.getParameter("tckPRP4") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tckPRP4", "true");
+        TestLink tl =
+            new TestLink("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr6 = portletResp.createResourceURL();
+        resurlTr6.setParameter("action",
+            "V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7");
+        writer.write("<DIV id=\"tr6\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr6','" + resurlTr6.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12 */
+    /* Details: "If the portlet sets a resource parameter with the same */
+    /* name as a public render parameter, this results in a multi-valued */
+    /* parameter. The public render parameter values must be the last */
+    /* entries in the parameter value array" */
+    {
+      if (portletReq.getParameter("tckPRP4") == null) {
+        PortletURL purl = portletResp.createRenderURL();
+        purl.setParameter("tckPRP4", "true");
+        TestLink tl =
+            new TestLink("V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12", purl);
+        tl.writeTo(writer);
+      } else {
+        ResourceURL resurlTr7 = portletResp.createResourceURL();
+        resurlTr7.setParameter("tckPRP4", "false");
+        resurlTr7.setParameter("action",
+            "V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12");
+        writer.write("<DIV id=\"tr7\"></DIV>");
+        writer.write("<script type=\"text/javascript\">");
+        writer.write("getResource('tr7','" + resurlTr7.toString() + "');");
+        writer.write("</script>");
+      }
+    }
+  }
 
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0749f2a8/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceAttr.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceAttr.java b/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceAttr.java
index cb4a436..d26ef82 100644
--- a/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceAttr.java
+++ b/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceAttr.java
@@ -1,145 +1,129 @@
-/*  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;
 
 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 AddlRequestTests_SPEC2_11_ResourceAttr_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
+ * AddlRequestTests_SPEC2_11_ResourceAttr_event
+ * @author ahmed
  */
 public class AddlRequestTests_SPEC2_11_ResourceAttr implements Portlet, ResourceServingPortlet {
-   private static final String LOG_CLASS = 
-         AddlRequestTests_SPEC2_11_ResourceAttr.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: V2AddlRequestTests_SPEC2_11_ResourceAttr_attributes1       */
-      /* Details: "The portlet can access a map with user information         */
-      /* attributes via the request attribute PortletRequest.USER_INFO"       */
-      TestResult tr0 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEATTR_ATTRIBUTES1);
-      /* TODO: implement test */
-      tr0.appendTcDetail("Not implemented.");
-      tr0.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceAttr_attributes2       */
-      /* Details: "The PortletRequest.CCPP_PROFILE request attribute must     */
-      /* return a javax.ccpp.Profile based on the current portlet request"    */
-      TestResult tr1 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEATTR_ATTRIBUTES2);
-      /* TODO: implement test */
-      tr1.appendTcDetail("Not implemented.");
-      tr1.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceAttr_attributes9       */
-      /* Details: "During resource processing, the LIFECYCLE_PHASE            */
-      /* (\"javax.portlet.lifecycle_phase\") attribute will contain the       */
-      /* string \"RESOURCE_PHASE\""                                           */
-      TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEATTR_ATTRIBUTES9);
-      /* TODO: implement test */
-      tr2.appendTcDetail("Not implemented.");
-      tr2.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=\"AddlRequestTests_SPEC2_11_ResourceAttr\">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(\"AddlRequestTests_SPEC2_11_ResourceAttr\").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 = AddlRequestTests_SPEC2_11_ResourceAttr.class.getName();
+  private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
+
+  @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);
+  }
+
+  @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: V2AddlRequestTests_SPEC2_11_ResourceAttr_attributes1 */
+    /* Details: "The portlet can access a map with user information */
+    /* attributes via the request attribute PortletRequest.USER_INFO" */
+    TestResult tr0 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEATTR_ATTRIBUTES1);
+    if (portletReq.getAttribute(PortletRequest.USER_INFO) != null) {
+      tr0.setTcSuccess(true);
+    }
+    tr0.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceAttr_attributes2 */
+    /* Details: "The PortletRequest.CCPP_PROFILE request attribute must */
+    /* return a javax.ccpp.Profile based on the current portlet request" */
+    TestResult tr1 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEATTR_ATTRIBUTES2);
+    if (portletReq.getAttribute(PortletRequest.CCPP_PROFILE) != null) {
+      tr1.setTcSuccess(true);
+    }
+    tr1.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceAttr_attributes9 */
+    /* Details: "During resource processing, the LIFECYCLE_PHASE */
+    /* (\"javax.portlet.lifecycle_phase\") attribute will contain the */
+    /* string \"RESOURCE_PHASE\"" */
+    TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEATTR_ATTRIBUTES9);
+    if (portletReq.getAttribute(PortletRequest.LIFECYCLE_PHASE).equals("RESOURCE_PHASE")) {
+      tr2.setTcSuccess(true);
+    }
+    tr2.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=\"AddlRequestTests_SPEC2_11_ResourceAttr\">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(\"AddlRequestTests_SPEC2_11_ResourceAttr\").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");
+  }
 
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0749f2a8/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceReq.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceReq.java b/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceReq.java
index ad002b8..df1fe7e 100644
--- a/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceReq.java
+++ b/portlet-tck_3.0/V2AddlRequestTests/src/main/java/javax/portlet/tck/portlets/AddlRequestTests_SPEC2_11_ResourceReq.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,169 +18,179 @@ 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 org.apache.commons.lang3.StringUtils;
+
 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 AddlRequestTests_SPEC2_11_ResourceReq_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
+ * AddlRequestTests_SPEC2_11_ResourceReq_event
+ * @author ahmed
  */
 public class AddlRequestTests_SPEC2_11_ResourceReq implements Portlet, ResourceServingPortlet {
-   private static final String LOG_CLASS = 
-         AddlRequestTests_SPEC2_11_ResourceReq.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: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType1       */
-      /* Details: "The getResponseContentType method returns a String         */
-      /* representing the default content type the portlet container          */
-      /* assumes for the output"                                              */
-      TestResult tr0 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE1);
-      /* TODO: implement test */
-      tr0.appendTcDetail("Not implemented.");
-      tr0.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType2       */
-      /* Details: "The getResponseContentTypes method returns an              */
-      /* Enumeration of String elements representing the acceptable content   */
-      /* types for the output in order of preference"                         */
-      TestResult tr1 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE2);
-      /* TODO: implement test */
-      tr1.appendTcDetail("Not implemented.");
-      tr1.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType3       */
-      /* Details: "The first element of the Enumeration returned by the       */
-      /* getResponseContentTypes method must equal the value returned by      */
-      /* the getResponseContentType method"                                   */
-      TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE3);
-      /* TODO: implement test */
-      tr2.appendTcDetail("Not implemented.");
-      tr2.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType4       */
-      /* Details: "If a portlet defines support for all content types using   */
-      /* a wildcard and the portlet container supports all content types,     */
-      /* the getResponseContentType may return the wildcard"                  */
-      TestResult tr3 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE4);
-      /* TODO: implement test */
-      tr3.appendTcDetail("Not implemented.");
-      tr3.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType5       */
-      /* Details: "If a portlet defines support for all content types using   */
-      /* a wildcard and the portlet container supports all content types,     */
-      /* the getResponseContentType may return the preferred content type"    */
-      TestResult tr4 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE5);
-      /* TODO: implement test */
-      tr4.appendTcDetail("Not implemented.");
-      tr4.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_windowId4          */
-      /* Details: "The string returned by getWindowID method must be the      */
-      /* same ID used for scoping portlet-scope session attributes"           */
-      TestResult tr5 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_WINDOWID4);
-      /* TODO: implement test */
-      tr5.appendTcDetail("Not implemented.");
-      tr5.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType12      */
-      /* Details: "Within the serveResource method, the content type should   */
-      /* be based on the HTTP Accept header provided by the client"           */
-      TestResult tr6 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE12);
-      /* TODO: implement test */
-      tr6.appendTcDetail("Not implemented.");
-      tr6.writeTo(writer);
-
-      /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType13      */
-      /* Details: "The character set of the response can be retrieved via     */
-      /* the RenderResponse.getCharacterEncoding method"                      */
-      TestResult tr7 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE13);
-      /* TODO: implement test */
-      tr7.appendTcDetail("Not implemented.");
-      tr7.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=\"AddlRequestTests_SPEC2_11_ResourceReq\">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(\"AddlRequestTests_SPEC2_11_ResourceReq\").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 = AddlRequestTests_SPEC2_11_ResourceReq.class.getName();
+  private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
+
+  @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);
+  }
+
+  @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: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType1 */
+    /* Details: "The getResponseContentType method returns a String */
+    /* representing the default content type the portlet container */
+    /* assumes for the output" */
+    TestResult tr0 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE1);
+    if (portletReq.getResponseContentType() != null
+        && !portletReq.getResponseContentType().isEmpty())
+      tr0.setTcSuccess(true);
+    tr0.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType2 */
+    /* Details: "The getResponseContentTypes method returns an */
+    /* Enumeration of String elements representing the acceptable content */
+    /* types for the output in order of preference" */
+    TestResult tr1 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE2);
+    Enumeration<String> contentTypesTr1 = portletReq.getResponseContentTypes();
+    if (contentTypesTr1 != null && contentTypesTr1.hasMoreElements()
+        && !contentTypesTr1.nextElement().isEmpty())
+      tr1.setTcSuccess(true);
+    tr1.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType3 */
+    /* Details: "The first element of the Enumeration returned by the */
+    /* getResponseContentTypes method must equal the value returned by */
+    /* the getResponseContentType method" */
+    TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE3);
+    if (portletReq.getResponseContentTypes().nextElement()
+        .equals(portletReq.getResponseContentType()))
+      tr2.setTcSuccess(true);
+    tr2.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType4 */
+    /* Details: "If a portlet defines support for all content types using */
+    /* a wildcard and the portlet container supports all content types, */
+    /* the getResponseContentType may return the wildcard" */
+    TestResult tr3 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE4);
+    if (portletReq.getResponseContentType().equals("*/*")) {
+      tr3.setTcSuccess(true);
+    } else {
+      tr3.appendTcDetail("Content type is " + portletReq.getResponseContentType());
+    }
+    tr3.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType5 */
+    /* Details: "If a portlet defines support for all content types using */
+    /* a wildcard and the portlet container supports all content types, */
+    /* the getResponseContentType may return the preferred content type" */
+    TestResult tr4 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE5);
+    if (portletReq.getResponseContentType().equals("*/*")) {
+      tr4.setTcSuccess(true);
+    } else {
+      tr4.appendTcDetail("Content type is " + portletReq.getResponseContentType());
+    }
+    tr4.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_windowId4 */
+    /* Details: "The string returned by getWindowID method must be the */
+    /* same ID used for scoping portlet-scope session attributes" */
+    TestResult tr5 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_WINDOWID4);
+    portletReq.getPortletSession().setAttribute("tr5", portletReq.getWindowID(), PORTLET_SCOPE);
+    String tr5SessionAttribute = (String) portletReq.getPortletSession()
+        .getAttribute("javax.portlet.p." + portletReq.getWindowID() + "?tr5", APPLICATION_SCOPE);
+    if (tr5SessionAttribute != null && tr5SessionAttribute.equals(portletReq.getWindowID())) {
+      tr5.setTcSuccess(true);
+    } else {
+      tr5.appendTcDetail(
+          "Couldn't find javax.portlet.p." + portletReq.getWindowID() + ".tr5 attribute");
+    }
+    tr5.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType12 */
+    /* Details: "Within the serveResource method, the content type should */
+    /* be based on the HTTP Accept header provided by the client" */
+    TestResult tr6 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE12);
+    if (!StringUtils.containsIgnoreCase(portletReq.getResponseContentType(),
+        portletReq.getCharacterEncoding()))
+      tr6.setTcSuccess(true);
+    tr6.writeTo(writer);
+
+    /* TestCase: V2AddlRequestTests_SPEC2_11_ResourceReq_contentType13 */
+    /* Details: "The character set of the response can be retrieved via */
+    /* the RenderResponse.getCharacterEncoding method" */
+    TestResult tr7 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_RESOURCEREQ_CONTENTTYPE13);
+    if (portletReq.getCharacterEncoding() != null) {
+      tr7.setTcSuccess(true);
+    } else {
+      tr7.appendTcDetail("getCharacterEncoding() returned null.");
+    }
+    tr7.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=\"AddlRequestTests_SPEC2_11_ResourceReq\">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(\"AddlRequestTests_SPEC2_11_ResourceReq\").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");
+  }
 
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0749f2a8/portlet-tck_3.0/V2AddlRequestTests/src/main/resources/xml-resources/additionalTCs.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlRequestTests/src/main/resources/xml-resources/additionalTCs.xml b/portlet-tck_3.0/V2AddlRequestTests/src/main/resources/xml-resources/additionalTCs.xml
index ff193b9..7e4449a 100644
--- a/portlet-tck_3.0/V2AddlRequestTests/src/main/resources/xml-resources/additionalTCs.xml
+++ b/portlet-tck_3.0/V2AddlRequestTests/src/main/resources/xml-resources/additionalTCs.xml
@@ -20,7 +20,6 @@
 <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
 <properties>
 <!-- JSR 286 API AddlRequestTests test case names and page mappings -->
-<entry key="V2AddlRequestTests_SPEC2_11_Action_parameters1">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Action_parameters2">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Action_parameters6">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Action_parameters8">V2AddlRequestTests</entry>
@@ -29,7 +28,6 @@
 <entry key="V2AddlRequestTests_SPEC2_11_Action_publicRenderParameters16">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Action_publicRenderParameters4">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Action_publicRenderParameters11">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Event_parameters1">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Event_parameters2">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Event_parameters6">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Event_parameters12">V2AddlRequestTests</entry>
@@ -40,17 +38,11 @@
 <entry key="V2AddlRequestTests_SPEC2_11_Render_parameters11">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_parameters13">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_parameters15">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Render_parameters1">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_parameters2">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_parameters6">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters15">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters16">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters1">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters2">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters6">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters13">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Render_publicRenderParameters13a">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_Resource_parameters1">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Resource_parameters2">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Resource_parameters6">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Resource_parameters17">V2AddlRequestTests</entry>
@@ -58,9 +50,6 @@
 <entry key="V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters16">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters7">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_Resource_publicRenderParameters12">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_RenderPRP_publicRenderParameters8">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_RenderPRP_publicRenderParameters9">V2AddlRequestTests</entry>
-<entry key="V2AddlRequestTests_SPEC2_11_RenderPRP_publicRenderParameters10">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_RenderAttr_attributes1">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_RenderAttr_attributes2">V2AddlRequestTests</entry>
 <entry key="V2AddlRequestTests_SPEC2_11_RenderAttr_attributes3">V2AddlRequestTests</entry>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/0749f2a8/portlet-tck_3.0/V2AddlRequestTests/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlRequestTests/src/main/webapp/WEB-INF/portlet.xml b/portlet-tck_3.0/V2AddlRequestTests/src/main/webapp/WEB-INF/portlet.xml
index c42c01f..e9f9e7f 100644
--- a/portlet-tck_3.0/V2AddlRequestTests/src/main/webapp/WEB-INF/portlet.xml
+++ b/portlet-tck_3.0/V2AddlRequestTests/src/main/webapp/WEB-INF/portlet.xml
@@ -33,6 +33,8 @@
       <portlet-info>
          <title>AddlRequestTests_SPEC2_11_Action</title>
       </portlet-info>
+      <supported-public-render-parameter>tckPRP1</supported-public-render-parameter>
+      <supported-public-render-parameter>tckPRP1a</supported-public-render-parameter>
    </portlet>
 
    <portlet>
@@ -49,6 +51,10 @@
       <supported-publishing-event>
          <qname>tck:AddlRequestTests_SPEC2_11_Event</qname>
       </supported-publishing-event>
+      <supported-processing-event>
+         <qname>tck:AddlRequestTests_SPEC2_11_Event</qname>
+      </supported-processing-event>
+      <supported-public-render-parameter>tckPRP2</supported-public-render-parameter>
    </portlet>
 
    <portlet>
@@ -65,6 +71,7 @@
       <supported-processing-event>
          <qname>tck:AddlRequestTests_SPEC2_11_Event</qname>
       </supported-processing-event>
+      <supported-public-render-parameter>tckPRP2</supported-public-render-parameter>
    </portlet>
 
    <portlet>
@@ -78,32 +85,36 @@
       <portlet-info>
          <title>AddlRequestTests_SPEC2_11_Render</title>
       </portlet-info>
+      <supported-public-render-parameter>tckPRP3</supported-public-render-parameter>
+      <supported-public-render-parameter>tr1_ready</supported-public-render-parameter>
    </portlet>
-
+   
    <portlet>
-      <portlet-name>AddlRequestTests_SPEC2_11_Resource</portlet-name>
-      <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_Resource</portlet-class>
+      <portlet-name>AddlRequestTests_SPEC2_11_Render_parameter11</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_Render_parameter11</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
          <mime-type>text/html</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
-         <title>AddlRequestTests_SPEC2_11_Resource</title>
+         <title>AddlRequestTests_SPEC2_11_Render_parameter11</title>
       </portlet-info>
+      <supported-public-render-parameter>tr1_ready</supported-public-render-parameter>
    </portlet>
 
    <portlet>
-      <portlet-name>AddlRequestTests_SPEC2_11_RenderPRP</portlet-name>
-      <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_RenderPRP</portlet-class>
+      <portlet-name>AddlRequestTests_SPEC2_11_Resource</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_Resource</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
          <mime-type>text/html</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
-         <title>AddlRequestTests_SPEC2_11_RenderPRP</title>
+         <title>AddlRequestTests_SPEC2_11_Resource</title>
       </portlet-info>
+      <supported-public-render-parameter>tckPRP2</supported-public-render-parameter>
    </portlet>
 
    <portlet>
@@ -118,6 +129,23 @@
          <title>AddlRequestTests_SPEC2_11_RenderAttr</title>
       </portlet-info>
    </portlet>
+   
+   <portlet>
+      <portlet-name>AddlRequestTests_SPEC2_11_RenderAttr_RenderHeaders</portlet-name>
+      <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_RenderAttr_RenderHeaders</portlet-class>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+      </supports>
+      <supported-locale>en_US</supported-locale>
+      <portlet-info>
+         <title>AddlRequestTests_SPEC2_11_RenderAttr_RenderHeaders</title>
+      </portlet-info>
+      <container-runtime-option>
+         <name>javax.portlet.renderHeaders</name>
+         <value>true</value>
+      </container-runtime-option>
+   </portlet>
 
    <portlet>
       <portlet-name>AddlRequestTests_SPEC2_11_ActionAttr</portlet-name>
@@ -182,7 +210,7 @@
       <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_ActionReq</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
-         <mime-type>text/html</mime-type>
+         <mime-type>*/*</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
@@ -195,7 +223,7 @@
       <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_EventReq</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
-         <mime-type>text/html</mime-type>
+         <mime-type>*/*</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
@@ -211,7 +239,7 @@
       <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_EventReq_event</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
-         <mime-type>text/html</mime-type>
+         <mime-type>*/*</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
@@ -227,7 +255,7 @@
       <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_RenderReq</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
-         <mime-type>text/html</mime-type>
+         <mime-type>*/*</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
@@ -240,7 +268,7 @@
       <portlet-class>javax.portlet.tck.portlets.AddlRequestTests_SPEC2_11_ResourceReq</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
-         <mime-type>text/html</mime-type>
+         <mime-type>*/*</mime-type>
       </supports>
       <supported-locale>en_US</supported-locale>
       <portlet-info>
@@ -285,6 +313,26 @@
 
    <public-render-parameter>
       <identifier>tckPRP1</identifier>
-      <qname>tck:tckPRP1</qname>
+      <qname xmlns:x="http://www.apache.org/portals/pluto/pub-render-params">tck:tckPRP1</qname>
+   </public-render-parameter>
+   <public-render-parameter>
+      <identifier>tr1_ready</identifier>
+      <qname xmlns:x="http://www.apache.org/portals/pluto/pub-render-params">tck:tr1_ready</qname>
+   </public-render-parameter>
+   <public-render-parameter>
+      <identifier>tckPRP1a</identifier>
+      <qname xmlns:x="http://www.apache.org/portals/pluto/pub-render-params">tck:tckPRP1a</qname>
+   </public-render-parameter>
+   <public-render-parameter>
+      <identifier>tckPRP2</identifier>
+      <qname xmlns:x="http://www.apache.org/portals/pluto/pub-render-params">tck:tckPRP2</qname>
+   </public-render-parameter>
+   <public-render-parameter>
+      <identifier>tckPRP3</identifier>
+      <qname xmlns:x="http://www.apache.org/portals/pluto/pub-render-params">tck:tckPRP3</qname>
+   </public-render-parameter>
+   <public-render-parameter>
+      <identifier>tckPRP4</identifier>
+      <qname xmlns:x="http://www.apache.org/portals/pluto/pub-render-params">tck:tckPRP4</qname>
    </public-render-parameter>
 </portlet-app>


Mime
View raw message