portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [34/36] portals-pluto git commit: Cleaned up V2ResponseTests from extraneous logging and imports. Also, replaced TestButton, TestSetupLink, TestSetup strings with Constants from tck beans.
Date Tue, 28 Jun 2016 15:31:38 GMT
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/35346423/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiAction.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiAction.java b/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiAction.java
index 53c0842..33d12d3 100644
--- a/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiAction.java
+++ b/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiAction.java
@@ -18,43 +18,63 @@
 
 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.JSR286ApiTestCaseDetails.*;
-import static javax.portlet.tck.constants.Constants.*;
-import static javax.portlet.PortletSession.*;
-import static javax.portlet.ResourceURL.*;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB3;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB4;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY3;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_GETNAMESPACE1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT3;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT4;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT5;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT6;
+import static javax.portlet.PortletSession.APPLICATION_SCOPE;
+import static javax.portlet.tck.constants.Constants.RESULT_ATTR_PREFIX;
+import static javax.portlet.tck.constants.Constants.THREADID_ATTR;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.tck.beans.JSR286ApiTestCaseDetails;
+import javax.portlet.tck.beans.TestButton;
+import javax.portlet.tck.beans.TestResult;
+import javax.portlet.tck.constants.Constants;
 
 /**
- * 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 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 ResponseTests_PortletResponse_ApiAction_event
+ * 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
+ * ResponseTests_PortletResponse_ApiAction_event
  *
  */
-public class ResponseTests_PortletResponse_ApiAction implements Portlet, ResourceServingPortlet {
-   private static final String LOG_CLASS = 
-         ResponseTests_PortletResponse_ApiAction.class.getName();
-   private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
-   
-   private PortletConfig portletConfig = null;
+public class ResponseTests_PortletResponse_ApiAction implements Portlet {
 
    @Override
    public void init(PortletConfig config) throws PortletException {
-      this.portletConfig = config;
    }
 
    @Override
@@ -62,8 +82,8 @@ public class ResponseTests_PortletResponse_ApiAction implements Portlet, Resourc
    }
 
    @Override
-   public void processAction(ActionRequest portletReq, ActionResponse portletResp)
-         throws PortletException, IOException {
+   public void processAction(ActionRequest portletReq,
+         ActionResponse portletResp) throws PortletException, IOException {
 
       portletResp.setRenderParameters(portletReq.getParameterMap());
       long tid = Thread.currentThread().getId();
@@ -75,20 +95,21 @@ public class ResponseTests_PortletResponse_ApiAction implements Portlet, Resourc
 
       // Create result objects for the tests
 
-      ClassChecker cc = new ClassChecker(portletResp.getClass());
-
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA1    */
-      /* Details: "Method addProperty(javax.servlet.http.Cookie): Adds the    */
-      /* specified cookie property to the response"                           */
-      TestResult tr0 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA1);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA1 */
+      /* Details: "Method addProperty(javax.servlet.http.Cookie): Adds the */
+      /* specified cookie property to the response" */
+      TestResult tr0 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA1);
       tr0.setTcSuccess(true);
-      tr0.appendTcDetail("This Method Could not be tested as Specified Property cannot be added to the response for this Test Portlets ");
+      tr0.appendTcDetail(
+            "This Method Could not be tested as Specified Property cannot be added to the response for this Test Portlets ");
       tr0.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA2    */
-      /* Details: "Method addProperty(javax.servlet.http.Cookie): Throws      */
-      /* IllegalArgumentException if the specified cookie is null"            */
-      TestResult tr1 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA2);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA2 */
+      /* Details: "Method addProperty(javax.servlet.http.Cookie): Throws */
+      /* IllegalArgumentException if the specified cookie is null" */
+      TestResult tr1 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA2);
       try {
          try {
             portletResp.addProperty(null);
@@ -98,55 +119,67 @@ public class ResponseTests_PortletResponse_ApiAction implements Portlet, Resourc
          } catch (Exception e) {
             tr1.appendTcDetail(e.toString());
          }
-      } catch(Exception e) {tr1.appendTcDetail(e.toString());}
+      } catch (Exception e) {
+         tr1.appendTcDetail(e.toString());
+      }
       tr1.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB1    */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): Adds an   */
-      /* XML DOM Element to the response for the specified key"               */
-      TestResult tr2 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB1);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB1 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): Adds an */
+      /* XML DOM Element to the response for the specified key" */
+      TestResult tr2 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB1);
       tr2.setTcSuccess(true);
-      tr2.appendTcDetail("This Method Could not be tested as XML DOM element cannot be added to the response for this Test Portlets ");
+      tr2.appendTcDetail(
+            "This Method Could not be tested as XML DOM element cannot be added to the response for this Test Portlets ");
       tr2.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB3    */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): If the    */
-      /* specified DOM Element value is null, the key is removed from the     */
-      /* response"                                                            */
-      TestResult tr3 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB3);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB3 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): If the */
+      /* specified DOM Element value is null, the key is removed from the */
+      /* response" */
+      TestResult tr3 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB3);
       tr3.setTcSuccess(true);
-      tr3.appendTcDetail("This Method Could not be tested as XML DOM element cannot be added to the response for this Test Portlets ");
+      tr3.appendTcDetail(
+            "This Method Could not be tested as XML DOM element cannot be added to the response for this Test Portlets ");
       tr3.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB4    */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): Throws    */
-      /* IllegalArgumentException if the specified key is null"               */
-      TestResult tr4 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB4);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB4 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): Throws */
+      /* IllegalArgumentException if the specified key is null" */
+      TestResult tr4 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB4);
       try {
          try {
             org.w3c.dom.Element el = portletResp.createElement("p");
-            portletResp.addProperty((String)null, el);
+            portletResp.addProperty((String) null, el);
             tr4.appendTcDetail("Method did not throw an exception.");
          } catch (IllegalArgumentException iae) {
             tr4.setTcSuccess(true);
          } catch (Exception e) {
             tr4.appendTcDetail(e.toString());
          }
-      } catch(Exception e) {tr4.appendTcDetail(e.toString());}
+      } catch (Exception e) {
+         tr4.appendTcDetail(e.toString());
+      }
       tr4.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC1    */
-      /* Details: "Method addProperty(String, String): A property can be      */
-      /* added"                                                               */
-      TestResult tr5 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC1);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC1 */
+      /* Details: "Method addProperty(String, String): A property can be */
+      /* added" */
+      TestResult tr5 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC1);
       tr5.setTcSuccess(true);
-      tr5.appendTcDetail("This Method could not be Tested as Property cannot be added to the Response for this Test Portlet");
+      tr5.appendTcDetail(
+            "This Method could not be Tested as Property cannot be added to the Response for this Test Portlet");
       tr5.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC2    */
-      /* Details: "Method addProperty(String, String): Throws                 */
-      /* IllegalArgumentException if the specified key is null"               */
-      TestResult tr6 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC2);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC2 */
+      /* Details: "Method addProperty(String, String): Throws */
+      /* IllegalArgumentException if the specified key is null" */
+      TestResult tr6 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC2);
       try {
          try {
             portletResp.addProperty(null, "value");
@@ -156,21 +189,26 @@ public class ResponseTests_PortletResponse_ApiAction implements Portlet, Resourc
          } catch (Exception e) {
             tr6.appendTcDetail(e.toString());
          }
-      } catch(Exception e) {tr6.appendTcDetail(e.toString());}
+      } catch (Exception e) {
+         tr6.appendTcDetail(e.toString());
+      }
       tr6.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty1     */
-      /* Details: "Method setProperty(String, String): Sets a property        */
-      /* value for the specified key"                                         */
-      TestResult tr7 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY1);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty1 */
+      /* Details: "Method setProperty(String, String): Sets a property */
+      /* value for the specified key" */
+      TestResult tr7 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY1);
       tr7.setTcSuccess(true);
-      tr7.appendTcDetail("This Method Could not be Tested as Property value cannot be added to Response for this Test Portlet");
+      tr7.appendTcDetail(
+            "This Method Could not be Tested as Property value cannot be added to Response for this Test Portlet");
       tr7.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty3     */
-      /* Details: "Method setProperty(String, String): Throws                 */
-      /* IllegalArgumentException if the specified key is null"               */
-      TestResult tr8 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY3);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty3 */
+      /* Details: "Method setProperty(String, String): Throws */
+      /* IllegalArgumentException if the specified key is null" */
+      TestResult tr8 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY3);
       try {
          try {
             portletResp.setProperty(null, "value");
@@ -180,147 +218,148 @@ public class ResponseTests_PortletResponse_ApiAction implements Portlet, Resourc
          } catch (Exception e) {
             tr8.appendTcDetail(e.toString());
          }
-      } catch(Exception e) {tr8.appendTcDetail(e.toString());}
+      } catch (Exception e) {
+         tr8.appendTcDetail(e.toString());
+      }
       tr8.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL1       */
-      /* Details: "Method encodeURL(String): Returns a String representing    */
-      /* the encoded URL"                                                     */
-      TestResult tr9 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL1);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL1 */
+      /* Details: "Method encodeURL(String): Returns a String representing */
+      /* the encoded URL" */
+      TestResult tr9 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL1);
       try {
-    	  String ecode=portletResp.encodeURL("/sample.img");
-    	  if(ecode.equals("/sample.img")) {
-    		  tr9.setTcSuccess(true);
-    	  }
-      } catch(IllegalArgumentException iae) {
-    	  tr9.appendTcDetail(iae.toString());
+         String ecode = portletResp.encodeURL("/sample.img");
+         if (ecode.equals("/sample.img")) {
+            tr9.setTcSuccess(true);
+         }
+      } catch (IllegalArgumentException iae) {
+         tr9.appendTcDetail(iae.toString());
       }
       tr9.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL2       */
-      /* Details: "Method encodeURL(String): Throws                           */
-      /* IllegalArgumentException if the input string is not an absolute      */
-      /* URL and does not start with at \"/\" character"                      */
-      TestResult tr10 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL2);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL2 */
+      /* Details: "Method encodeURL(String): Throws */
+      /* IllegalArgumentException if the input string is not an absolute */
+      /* URL and does not start with at \"/\" character" */
+      TestResult tr10 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL2);
       try {
-    	  String ecode=portletResp.encodeURL("sample.img");
-    	  tr10.appendTcDetail("Method Did not Throw Exception");
-      } catch(IllegalArgumentException iae) {
-    	  tr10.setTcSuccess(true);
+         portletResp.encodeURL("sample.img");
+         tr10.appendTcDetail("Method Did not Throw Exception");
+      } catch (IllegalArgumentException iae) {
+         tr10.setTcSuccess(true);
       }
       tr10.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_getNamespace1    */
-      /* Details: "Method getNamespace(): Returns a String containing the     */
-      /* namespace value"                                                     */
-      TestResult tr11 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_GETNAMESPACE1);
-      String getName=portletResp.getNamespace();
-      if(getName!=null){
-    	  tr11.setTcSuccess(true);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_getNamespace1 */
+      /* Details: "Method getNamespace(): Returns a String containing the */
+      /* namespace value" */
+      TestResult tr11 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_GETNAMESPACE1);
+      String getName = portletResp.getNamespace();
+      if (getName != null) {
+         tr11.setTcSuccess(true);
       }
       tr11.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement1   */
-      /* Details: "Method createElement(String): Returns an                   */
-      /* org.w3c.dom.Element object for the specified tag name"               */
-      TestResult tr12 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT1);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement1 */
+      /* Details: "Method createElement(String): Returns an */
+      /* org.w3c.dom.Element object for the specified tag name" */
+      TestResult tr12 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT1);
       try {
-    	  org.w3c.dom.Element el = portletResp.createElement("Test1");
-    	  if(el.getTagName().toString().equals("Test1")) {
-    		  tr12.setTcSuccess(true);
-    	  }
-    	  
-      } catch(org.w3c.dom.DOMException de) {
-    	  tr12.appendTcDetail(de.toString());
+         org.w3c.dom.Element el = portletResp.createElement("Test1");
+         if (el.getTagName().toString().equals("Test1")) {
+            tr12.setTcSuccess(true);
+         }
+
+      } catch (org.w3c.dom.DOMException de) {
+         tr12.appendTcDetail(de.toString());
       }
       tr12.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement2   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* nodeName set to the the specified tag name "                         */
-      TestResult tr13 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT2);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement2 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* nodeName set to the the specified tag name " */
+      TestResult tr13 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT2);
       try {
-    	  org.w3c.dom.Element el = portletResp.createElement("Test2");
-    	  if(el.getNodeName().equals("Test2")) {
-    	  tr13.setTcSuccess(true);
-    	  }
-      } catch(org.w3c.dom.DOMException de) {
-    	  tr13.appendTcDetail(de.toString());
+         org.w3c.dom.Element el = portletResp.createElement("Test2");
+         if (el.getNodeName().equals("Test2")) {
+            tr13.setTcSuccess(true);
+         }
+      } catch (org.w3c.dom.DOMException de) {
+         tr13.appendTcDetail(de.toString());
       }
       tr13.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement3   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* localName set to null"                                               */
-      TestResult tr14 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT3);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement3 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* localName set to null" */
+      TestResult tr14 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT3);
       try {
-    	  org.w3c.dom.Element el = portletResp.createElement("Test3");
-    	  String loc=el.getLocalName();
-    	  if(loc==null) {
-    		  tr14.setTcSuccess(true);
-    	  }
-      } catch(org.w3c.dom.DOMException de) {
-    	  tr14.appendTcDetail(de.toString());
+         org.w3c.dom.Element el = portletResp.createElement("Test3");
+         String loc = el.getLocalName();
+         if (loc == null) {
+            tr14.setTcSuccess(true);
+         }
+      } catch (org.w3c.dom.DOMException de) {
+         tr14.appendTcDetail(de.toString());
       }
       tr14.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement4   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* prefix set to null"                                                  */
-      TestResult tr15 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT4);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement4 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* prefix set to null" */
+      TestResult tr15 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT4);
       try {
-    	  org.w3c.dom.Element el = portletResp.createElement("Test4");
-    	  String prefix=el.getPrefix();
-    	  if(prefix==null) {
-    		  tr15.setTcSuccess(true);
-    	  }
-      } catch(org.w3c.dom.DOMException de) {
-    	  tr15.appendTcDetail(de.toString());
+         org.w3c.dom.Element el = portletResp.createElement("Test4");
+         String prefix = el.getPrefix();
+         if (prefix == null) {
+            tr15.setTcSuccess(true);
+         }
+      } catch (org.w3c.dom.DOMException de) {
+         tr15.appendTcDetail(de.toString());
       }
       tr15.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement5   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* namespaceURI set to null"                                            */
-      TestResult tr16 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT5);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement5 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* namespaceURI set to null" */
+      TestResult tr16 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT5);
       try {
-    	  org.w3c.dom.Element el = portletResp.createElement("Test5");
-    	  String nameSpace=el.getNamespaceURI();
-    	  if(nameSpace==null) {
-    		  tr16.setTcSuccess(true);
-    	  }
-      } catch(org.w3c.dom.DOMException de) {
-    	  tr16.appendTcDetail(de.toString());
+         org.w3c.dom.Element el = portletResp.createElement("Test5");
+         String nameSpace = el.getNamespaceURI();
+         if (nameSpace == null) {
+            tr16.setTcSuccess(true);
+         }
+      } catch (org.w3c.dom.DOMException de) {
+         tr16.appendTcDetail(de.toString());
       }
       tr16.writeTo(writer);
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement6   */
-      /* Details: "Method createElement(String): Throws                       */
-      /* org.w3c.dom.DOMException - INVALID_CHARACTER_ERR if the specified    */
-      /* name contains an illegal character. "                                */
-      TestResult tr17 = tcd.getTestResultFailed(V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT6);
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement6 */
+      /* Details: "Method createElement(String): Throws */
+      /* org.w3c.dom.DOMException - INVALID_CHARACTER_ERR if the specified */
+      /* name contains an illegal character. " */
+      TestResult tr17 = tcd.getTestResultFailed(
+            V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT6);
       try {
-    	  org.w3c.dom.Element el = portletResp.createElement("$Test6");
-    	  tr17.appendTcDetail("Method did not Throw Exception");
-      } catch(org.w3c.dom.DOMException de) {
-    	  tr17.setTcSuccess(true);
+         portletResp.createElement("$Test6");
+         tr17.appendTcDetail("Method did not Throw Exception");
+      } catch (org.w3c.dom.DOMException de) {
+         tr17.setTcSuccess(true);
       }
       tr17.writeTo(writer);
 
       portletReq.getPortletSession().setAttribute(
-                   Constants.RESULT_ATTR_PREFIX + "ResponseTests_PortletResponse_ApiAction",
-                   writer.toString(), APPLICATION_SCOPE);
-   }
-
-   @Override
-   public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp)
-         throws PortletException, IOException {
-
-      long tid = Thread.currentThread().getId();
-      portletReq.setAttribute(THREADID_ATTR, tid);
-
-      PrintWriter writer = portletResp.getWriter();
-
+            Constants.RESULT_ATTR_PREFIX
+                  + "ResponseTests_PortletResponse_ApiAction",
+            writer.toString(), APPLICATION_SCOPE);
    }
 
    @Override
@@ -333,192 +372,214 @@ public class ResponseTests_PortletResponse_ApiAction implements Portlet, Resourc
       PrintWriter writer = portletResp.getWriter();
 
       PortletSession ps = portletReq.getPortletSession();
-      String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + "ResponseTests_PortletResponse_ApiAction", APPLICATION_SCOPE);
+      String msg = (String) ps.getAttribute(
+            RESULT_ATTR_PREFIX + "ResponseTests_PortletResponse_ApiAction",
+            APPLICATION_SCOPE);
       if (msg != null) {
          writer.write("<p>" + msg + "</p><br/>\n");
-         ps.removeAttribute(RESULT_ATTR_PREFIX + "ResponseTests_PortletResponse_ApiAction", APPLICATION_SCOPE);
+         ps.removeAttribute(
+               RESULT_ATTR_PREFIX + "ResponseTests_PortletResponse_ApiAction",
+               APPLICATION_SCOPE);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA1    */
-      /* Details: "Method addProperty(javax.servlet.http.Cookie): Adds the    */
-      /* specified cookie property to the response"                           */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA1 */
+      /* Details: "Method addProperty(javax.servlet.http.Cookie): Adds the */
+      /* specified cookie property to the response" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyA1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA2    */
-      /* Details: "Method addProperty(javax.servlet.http.Cookie): Throws      */
-      /* IllegalArgumentException if the specified cookie is null"            */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyA2 */
+      /* Details: "Method addProperty(javax.servlet.http.Cookie): Throws */
+      /* IllegalArgumentException if the specified cookie is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyA2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYA2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB1    */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): Adds an   */
-      /* XML DOM Element to the response for the specified key"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB1 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): Adds an */
+      /* XML DOM Element to the response for the specified key" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyB1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB3    */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): If the    */
-      /* specified DOM Element value is null, the key is removed from the     */
-      /* response"                                                            */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB3 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): If the */
+      /* specified DOM Element value is null, the key is removed from the */
+      /* response" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyB3", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB3, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB4    */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): Throws    */
-      /* IllegalArgumentException if the specified key is null"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyB4 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): Throws */
+      /* IllegalArgumentException if the specified key is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyB4", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYB4, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC1    */
-      /* Details: "Method addProperty(String, String): A property can be      */
-      /* added"                                                               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC1 */
+      /* Details: "Method addProperty(String, String): A property can be */
+      /* added" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyC1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC2    */
-      /* Details: "Method addProperty(String, String): Throws                 */
-      /* IllegalArgumentException if the specified key is null"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_addPropertyC2 */
+      /* Details: "Method addProperty(String, String): Throws */
+      /* IllegalArgumentException if the specified key is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_addPropertyC2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ADDPROPERTYC2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty1     */
-      /* Details: "Method setProperty(String, String): Sets a property        */
-      /* value for the specified key"                                         */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty1 */
+      /* Details: "Method setProperty(String, String): Sets a property */
+      /* value for the specified key" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_setProperty1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty3     */
-      /* Details: "Method setProperty(String, String): Throws                 */
-      /* IllegalArgumentException if the specified key is null"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_setProperty3 */
+      /* Details: "Method setProperty(String, String): Throws */
+      /* IllegalArgumentException if the specified key is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_setProperty3", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_SETPROPERTY3, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL1       */
-      /* Details: "Method encodeURL(String): Returns a String representing    */
-      /* the encoded URL"                                                     */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL1 */
+      /* Details: "Method encodeURL(String): Returns a String representing */
+      /* the encoded URL" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_encodeURL1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL2       */
-      /* Details: "Method encodeURL(String): Throws                           */
-      /* IllegalArgumentException if the input string is not an absolute      */
-      /* URL and does not start with at \"/\" character"                      */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_encodeURL2 */
+      /* Details: "Method encodeURL(String): Throws */
+      /* IllegalArgumentException if the input string is not an absolute */
+      /* URL and does not start with at \"/\" character" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_encodeURL2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_ENCODEURL2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_getNamespace1    */
-      /* Details: "Method getNamespace(): Returns a String containing the     */
-      /* namespace value"                                                     */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_getNamespace1 */
+      /* Details: "Method getNamespace(): Returns a String containing the */
+      /* namespace value" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_getNamespace1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_GETNAMESPACE1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement1   */
-      /* Details: "Method createElement(String): Returns an                   */
-      /* org.w3c.dom.Element object for the specified tag name"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement1 */
+      /* Details: "Method createElement(String): Returns an */
+      /* org.w3c.dom.Element object for the specified tag name" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_createElement1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement2   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* nodeName set to the the specified tag name "                         */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement2 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* nodeName set to the the specified tag name " */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_createElement2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement3   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* localName set to null"                                               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement3 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* localName set to null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_createElement3", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT3, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement4   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* prefix set to null"                                                  */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement4 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* prefix set to null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_createElement4", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT4, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement5   */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* namespaceURI set to null"                                            */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement5 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* namespaceURI set to null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_createElement5", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT5, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement6   */
-      /* Details: "Method createElement(String): Throws                       */
-      /* org.w3c.dom.DOMException - INVALID_CHARACTER_ERR if the specified    */
-      /* name contains an illegal character. "                                */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiAction_createElement6 */
+      /* Details: "Method createElement(String): Throws */
+      /* org.w3c.dom.DOMException - INVALID_CHARACTER_ERR if the specified */
+      /* name contains an illegal character. " */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiAction_createElement6", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIACTION_CREATEELEMENT6, aurl);
          tb.writeTo(writer);
       }
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/35346423/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiEvent.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiEvent.java b/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiEvent.java
index 5a11160..8b04447 100644
--- a/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiEvent.java
+++ b/portlet-tck_3.0/V2ResponseTests/src/main/java/javax/portlet/tck/portlets/ResponseTests_PortletResponse_ApiEvent.java
@@ -18,43 +18,58 @@
 
 package javax.portlet.tck.portlets;
 
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
-import static java.util.logging.Logger.*;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYA1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYA2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYB1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYB3;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYB4;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYC1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYC2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_SETPROPERTY1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_SETPROPERTY3;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ENCODEURL1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ENCODEURL2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_GETNAMESPACE1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT1;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT2;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT3;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT4;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT5;
+import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT6;
+import static javax.portlet.tck.constants.Constants.THREADID_ATTR;
+import static javax.portlet.tck.constants.Constants.TCKNAMESPACE;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.tck.beans.TestButton;
 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.JSR286ApiTestCaseDetails.*;
-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 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 ResponseTests_PortletResponse_ApiEvent_event
+ * 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
+ * ResponseTests_PortletResponse_ApiEvent_event
  *
  */
-public class ResponseTests_PortletResponse_ApiEvent implements Portlet, ResourceServingPortlet {
-   private static final String LOG_CLASS = 
-         ResponseTests_PortletResponse_ApiEvent.class.getName();
-   private final Logger LOGGER = Logger.getLogger(LOG_CLASS);
-   
-   private PortletConfig portletConfig = null;
+public class ResponseTests_PortletResponse_ApiEvent implements Portlet {
 
    @Override
    public void init(PortletConfig config) throws PortletException {
-      this.portletConfig = config;
    }
 
    @Override
@@ -62,32 +77,19 @@ public class ResponseTests_PortletResponse_ApiEvent implements Portlet, Resource
    }
 
    @Override
-   public void processAction(ActionRequest portletReq, ActionResponse portletResp)
-         throws PortletException, IOException {
+   public void processAction(ActionRequest portletReq,
+         ActionResponse portletResp) throws PortletException, IOException {
 
       portletResp.setRenderParameters(portletReq.getParameterMap());
       long tid = Thread.currentThread().getId();
       portletReq.setAttribute(THREADID_ATTR, tid);
 
-      StringWriter writer = new StringWriter();
-
       QName eventQName = new QName(TCKNAMESPACE,
-             "ResponseTests_PortletResponse_ApiEvent");
+            "ResponseTests_PortletResponse_ApiEvent");
       portletResp.setEvent(eventQName, "Hi!");
    }
 
    @Override
-   public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp)
-         throws PortletException, IOException {
-
-      long tid = Thread.currentThread().getId();
-      portletReq.setAttribute(THREADID_ATTR, tid);
-
-      PrintWriter writer = portletResp.getWriter();
-
-   }
-
-   @Override
    public void render(RenderRequest portletReq, RenderResponse portletResp)
          throws PortletException, IOException {
 
@@ -96,186 +98,204 @@ public class ResponseTests_PortletResponse_ApiEvent implements Portlet, Resource
 
       PrintWriter writer = portletResp.getWriter();
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyA1     */
-      /* Details: "Method addProperty(javax.servlet.http.Cookie): Adds the    */
-      /* specified cookie property to the response"                           */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyA1 */
+      /* Details: "Method addProperty(javax.servlet.http.Cookie): Adds the */
+      /* specified cookie property to the response" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyA1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYA1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyA2     */
-      /* Details: "Method addProperty(javax.servlet.http.Cookie): Throws      */
-      /* IllegalArgumentException if the specified cookie is null"            */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyA2 */
+      /* Details: "Method addProperty(javax.servlet.http.Cookie): Throws */
+      /* IllegalArgumentException if the specified cookie is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyA2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYA2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyB1     */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): Adds an   */
-      /* XML DOM Element to the response for the specified key"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyB1 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): Adds an */
+      /* XML DOM Element to the response for the specified key" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyB1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYB1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyB3     */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): If the    */
-      /* specified DOM Element value is null, the key is removed from the     */
-      /* response"                                                            */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyB3 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): If the */
+      /* specified DOM Element value is null, the key is removed from the */
+      /* response" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyB3", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYB3, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyB4     */
-      /* Details: "Method addProperty(String, org.w3c.dom.Element): Throws    */
-      /* IllegalArgumentException if the specified key is null"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyB4 */
+      /* Details: "Method addProperty(String, org.w3c.dom.Element): Throws */
+      /* IllegalArgumentException if the specified key is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyB4", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYB4, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyC1     */
-      /* Details: "Method addProperty(String, String): A property can be      */
-      /* added"                                                               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyC1 */
+      /* Details: "Method addProperty(String, String): A property can be */
+      /* added" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyC1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYC1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyC2     */
-      /* Details: "Method addProperty(String, String): Throws                 */
-      /* IllegalArgumentException if the specified key is null"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_addPropertyC2 */
+      /* Details: "Method addProperty(String, String): Throws */
+      /* IllegalArgumentException if the specified key is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_addPropertyC2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ADDPROPERTYC2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_setProperty1      */
-      /* Details: "Method setProperty(String, String): Sets a property        */
-      /* value for the specified key"                                         */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_setProperty1 */
+      /* Details: "Method setProperty(String, String): Sets a property */
+      /* value for the specified key" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_setProperty1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_SETPROPERTY1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_setProperty3      */
-      /* Details: "Method setProperty(String, String): Throws                 */
-      /* IllegalArgumentException if the specified key is null"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_setProperty3 */
+      /* Details: "Method setProperty(String, String): Throws */
+      /* IllegalArgumentException if the specified key is null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_setProperty3", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_SETPROPERTY3, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_encodeURL1        */
-      /* Details: "Method encodeURL(String): Returns a String representing    */
-      /* the encoded URL"                                                     */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_encodeURL1 */
+      /* Details: "Method encodeURL(String): Returns a String representing */
+      /* the encoded URL" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_encodeURL1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ENCODEURL1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_encodeURL2        */
-      /* Details: "Method encodeURL(String): Throws                           */
-      /* IllegalArgumentException if the input string is not an absolute      */
-      /* URL and does not start with at \"/\" character"                      */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_encodeURL2 */
+      /* Details: "Method encodeURL(String): Throws */
+      /* IllegalArgumentException if the input string is not an absolute */
+      /* URL and does not start with at \"/\" character" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_encodeURL2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_ENCODEURL2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_getNamespace1     */
-      /* Details: "Method getNamespace(): Returns a String containing the     */
-      /* namespace value"                                                     */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_getNamespace1 */
+      /* Details: "Method getNamespace(): Returns a String containing the */
+      /* namespace value" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_getNamespace1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_GETNAMESPACE1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement1    */
-      /* Details: "Method createElement(String): Returns an                   */
-      /* org.w3c.dom.Element object for the specified tag name"               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement1 */
+      /* Details: "Method createElement(String): Returns an */
+      /* org.w3c.dom.Element object for the specified tag name" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_createElement1", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT1, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement2    */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* nodeName set to the the specified tag name "                         */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement2 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* nodeName set to the the specified tag name " */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_createElement2", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT2, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement3    */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* localName set to null"                                               */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement3 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* localName set to null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_createElement3", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT3, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement4    */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* prefix set to null"                                                  */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement4 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* prefix set to null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_createElement4", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT4, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement5    */
-      /* Details: "Method createElement(String): The returned Element has     */
-      /* namespaceURI set to null"                                            */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement5 */
+      /* Details: "Method createElement(String): The returned Element has */
+      /* namespaceURI set to null" */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_createElement5", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT5, aurl);
          tb.writeTo(writer);
       }
 
-      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement6    */
-      /* Details: "Method createElement(String): Throws                       */
-      /* org.w3c.dom.DOMException - INVALID_CHARACTER_ERR if the specified    */
-      /* name contains an illegal character. "                                */
+      /* TestCase: V2ResponseTests_PortletResponse_ApiEvent_createElement6 */
+      /* Details: "Method createElement(String): Throws */
+      /* org.w3c.dom.DOMException - INVALID_CHARACTER_ERR if the specified */
+      /* name contains an illegal character. " */
       {
          PortletURL aurl = portletResp.createActionURL();
          aurl.setParameters(portletReq.getPrivateParameterMap());
-         TestButton tb = new TestButton("V2ResponseTests_PortletResponse_ApiEvent_createElement6", aurl);
+         TestButton tb = new TestButton(
+               V2RESPONSETESTS_PORTLETRESPONSE_APIEVENT_CREATEELEMENT6, aurl);
          tb.writeTo(writer);
       }
 


Mime
View raw message