portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [08/30] portals-pluto git commit: V2PortletTests
Date Fri, 22 Apr 2016 08:58:27 GMT
V2PortletTests


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

Branch: refs/heads/master
Commit: 5602490cd2a71e13b6dc524a77875c3b137343ef
Parents: 75be362
Author: Jayendran Anil Kumar <akumarj@de.ibm.com>
Authored: Sun Feb 28 21:13:58 2016 +0100
Committer: Jayendran Anil Kumar <akumarj@de.ibm.com>
Committed: Sun Feb 28 21:13:58 2016 +0100

----------------------------------------------------------------------
 .../ResourcePortlet-PRP/.gitignore              |  1 +
 .../ExamplePortlets/basicModePortlet/.gitignore |  1 +
 .../ExamplePortlets/basicPortlet/.gitignore     |  1 +
 .../ExamplePortlets/filterPortlet/.gitignore    |  1 +
 ...ortletTests_EventPortlet_ApiEvent_event.java | 19 +++---
 .../portlets/PortletTests_Event_ApiEvent.java   | 10 ++-
 .../PortletTests_Event_ApiEvent_event.java      | 31 ++++++---
 .../PortletTests_PortletConfig_ApiRender2.java  |  5 +-
 .../PortletTests_PortletMode_ApiRender.java     | 63 +++++++++--------
 .../PortletTests_Portlet_ApiAction.java         | 11 +--
 ...ests_ResourceServingPortlet_ApiResource.java |  9 +--
 .../PortletTests_WindowState_ApiRender.java     | 71 +++++++++++---------
 .../src/main/webapp/WEB-INF/portlet.xml         |  5 +-
 .../RequestTests_PortletRequest_ApiRender.java  |  2 +-
 .../javax/portlet/tck/beans/TestButton.java     |  7 +-
 .../javax/portlet/tck/constants/Constants.java  |  1 +
 16 files changed, 139 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/ExamplePortlets/ResourcePortlet-PRP/.gitignore
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/ExamplePortlets/ResourcePortlet-PRP/.gitignore b/portlet-tck_3.0/ExamplePortlets/ResourcePortlet-PRP/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/portlet-tck_3.0/ExamplePortlets/ResourcePortlet-PRP/.gitignore
@@ -0,0 +1 @@
+/bin/

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/ExamplePortlets/basicModePortlet/.gitignore
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/ExamplePortlets/basicModePortlet/.gitignore b/portlet-tck_3.0/ExamplePortlets/basicModePortlet/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/portlet-tck_3.0/ExamplePortlets/basicModePortlet/.gitignore
@@ -0,0 +1 @@
+/bin/

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/ExamplePortlets/basicPortlet/.gitignore
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/ExamplePortlets/basicPortlet/.gitignore b/portlet-tck_3.0/ExamplePortlets/basicPortlet/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/portlet-tck_3.0/ExamplePortlets/basicPortlet/.gitignore
@@ -0,0 +1 @@
+/bin/

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/ExamplePortlets/filterPortlet/.gitignore
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/ExamplePortlets/filterPortlet/.gitignore b/portlet-tck_3.0/ExamplePortlets/filterPortlet/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/portlet-tck_3.0/ExamplePortlets/filterPortlet/.gitignore
@@ -0,0 +1 @@
+/bin/

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java
index 1db6296..5779fb0 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java
@@ -83,20 +83,21 @@ public class PortletTests_EventPortlet_ApiEvent_event implements Portlet,
EventP
       // Create result objects for the tests
 
       ClassChecker cc = new ClassChecker(GenericPortlet.class);
-
+      
       /* TestCase: V2PortletTests_EventPortlet_ApiEvent_processEvent          */
       /* Details: "Method processEvent(EventRequest, EventResponse): is       */
       /* called when an event is targeted to the portlet"                     */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENTPORTLET_APIEVENT_PROCESSEVENT);
-      /* TODO: implement test */
       try {
-          String name = "processEvent";
-          Class<?> retType = void.class;
-          Class<?>[] parms = {EventRequest.class, EventResponse.class};
-          tr0.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr0.appendTcDetail(e.toString());}
-       tr0.writeTo(writer);
-
+    	  Event evt=portletReq.getEvent();
+          if(evt.getValue().toString().equals("Hi!")) {
+        	  tr0.setTcSuccess(true);  
+          } else {
+        	  tr0.appendTcDetail("The Event Payload has incorrect value :");	
+            }   
+      }catch(Exception e) {tr0.appendTcDetail(e.toString());}
+      tr0.writeTo(writer);
+      
       portletReq.getPortletSession().setAttribute(
                    Constants.RESULT_ATTR_PREFIX + "PortletTests_EventPortlet_ApiEvent",
                    writer.toString(), APPLICATION_SCOPE);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java
index 42fda42..ee9ed52 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java
@@ -71,10 +71,16 @@ public class PortletTests_Event_ApiEvent implements Portlet, ResourceServingPort
       portletReq.setAttribute(THREADID_ATTR, tid);
 
       StringWriter writer = new StringWriter();
-
+      
       QName eventQName = new QName(TCKNAMESPACE,
              "PortletTests_Event_ApiEvent");
-      portletResp.setEvent(eventQName, "Hi!");
+      String val = portletReq.getParameter(BUTTON_PARAM_NAME);
+      if (val != null  && val.equals(V2PORTLETTESTS_EVENT_APIEVENT_GETVALUE2)) {
 
+            portletResp.setEvent(eventQName,null);
+      }
+      else { 
+    	    portletResp.setEvent(eventQName,"Hi!");
+      }
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java
index 0fb93fe..50c00be 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java
@@ -57,6 +57,9 @@ public class PortletTests_Event_ApiEvent_event implements Portlet, EventPortlet,
    public void processAction(ActionRequest portletReq, ActionResponse portletResp)
          throws PortletException, IOException {
       LOGGER.entering(LOG_CLASS, "event companion processAction - ERROR!!");
+      QName eventQName = new QName(TCKNAMESPACE,
+              "PortletTests_Event_ApiEvent");
+       portletResp.setEvent(eventQName, "Hi!");
    }
 
    @Override
@@ -107,9 +110,13 @@ public class PortletTests_Event_ApiEvent_event implements Portlet, EventPortlet,
       /* Details: "Method getQName(): Returned value may not be null"         */
       TestResult tr1 = tcd.getTestResultSucceeded(V2PORTLETTESTS_EVENT_APIEVENT_GETQNAME2);
       QName qn1 = evt.getQName();
+      StringBuilder txt1=new StringBuilder(128);
+      txt1.append(qn1);
       if (qn1 == null) {
-         tr0.appendTcDetail("QName is null.");
+         tr1.appendTcDetail("QName is null.");
+         tr1.appendTcDetail(txt1.toString());
       } 
+      tr1.setTcSuccess(true);
       tr1.writeTo(writer);
       
       /* TestCase: V2PortletTests_Event_ApiEvent_getName1                     */
@@ -121,11 +128,11 @@ public class PortletTests_Event_ApiEvent_event implements Portlet, EventPortlet,
       if(qn2==null) {
     	  tr2.appendTcDetail("Local Part of Event name is Null.");
       } else if(!qn2.equals(evtname)) {
-      StringBuilder txt = new StringBuilder(128);
-      txt.append("EventName is not expected value.");
-      txt.append(" Expected: ").append(evtname);
-      txt.append(" Actual: ").append(qn2);
-      tr2.appendTcDetail(txt.toString());
+      StringBuilder txt2 = new StringBuilder(128);
+      txt2.append("EventName is not expected value.");
+      txt2.append(" Expected: ").append(evtname);
+      txt2.append(" Actual: ").append(qn2);
+      tr2.appendTcDetail(txt2.toString());
       }
       
       tr2.writeTo(writer);
@@ -150,11 +157,11 @@ public class PortletTests_Event_ApiEvent_event implements Portlet, EventPortlet,
     	  tr4.appendTcDetail("EventPayload is null");
       } 
       if ((val instanceof String)) {
-    	  String txt = (String) val;
-    	  if (txt.equals("Hi!")) {
+    	  String txt4 = (String) val;
+    	  if (txt4.equals("Hi!")) {
             tr4.setTcSuccess(true);  
     	  } else {  
-			tr4.appendTcDetail("The EventPayloadvalue did not match actual value :" + txt);	
+			tr4.appendTcDetail("The EventPayloadvalue did not match actual value :" + txt4);	
     	    }
        } 
       } catch(Exception e) {tr4.appendTcDetail(e.toString());}
@@ -163,10 +170,12 @@ public class PortletTests_Event_ApiEvent_event implements Portlet, EventPortlet,
       /* TestCase: V2PortletTests_Event_ApiEvent_getValue2                    */
       /* Details: "Method getValue(String, String): Returned value is null    */
       /* if the event has no payload"                                         */
-      TestResult tr5 = tcd.getTestResultSucceeded(V2PORTLETTESTS_EVENT_APIEVENT_GETVALUE2);
+      TestResult tr5 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETVALUE2);
       Serializable val1=evt.getValue();
       if(val1==null) {
-    	  tr5.appendTcDetail("EventPayload is null");
+    	  tr5.setTcSuccess(true);
+      } else {
+    	  tr5.appendTcDetail("EventPayload has a value:"+val1.toString());
       }
       tr5.writeTo(writer);
       

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
index b116fee..fc7123a 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletConfig_ApiRender2.java
@@ -160,8 +160,9 @@ private static final String XMLConstants = null;
       /* Details: "Method getPublishingEventQNames(): Returns an empty        */
       /* Enumeration if there are no processing events are defined"           */
       TestResult tr4 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETCONFIG_APIRENDER2_GETPUBLISHINGEVENTQNAMES2);
-      
-       tr4.writeTo(writer);
+      Enumeration<QName> evntqnames=portletConfig.getPublishingEventQNames();
+      tr4.appendTcDetail("PublishingEvnet"+evntqnames.toString());
+      tr4.writeTo(writer);
 
 
       /* TestCase: V2PortletTests_PortletConfig_ApiRender2_getProcessingEventQNames2 */

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletMode_ApiRender.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletMode_ApiRender.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletMode_ApiRender.java
index f615a3d..0428244 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletMode_ApiRender.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_PortletMode_ApiRender.java
@@ -97,7 +97,9 @@ public class PortletTests_PortletMode_ApiRender implements Portlet, ResourceServ
       PrintWriter writer = portletResp.getWriter();
 
       JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails();
-
+     
+      PortletMode mode=portletReq.getPortletMode();
+      
       // Create result objects for the tests
 
       ClassChecker cc = new ClassChecker(portletReq.getPortletMode().getClass());
@@ -106,18 +108,24 @@ public class PortletTests_PortletMode_ApiRender implements Portlet,
ResourceServ
       /* Details: "The constructor PortletMode(java.lang.String): allows a    */
       /* PortletMode object of the specified name to be constructed"          */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETMODE_APIRENDER_CONSTRUCTOR1);
-      try {
-          Class<?>[] parms = {String.class};
-          tr0.setTcSuccess(cc.hasConstructor(parms));
-       } catch(Exception e) {tr0.appendTcDetail(e.toString());}
+      WindowState ws=new WindowState("newmode");
+      if(ws!=null && ws.toString().equals("newmode")) {
+    	  tr0.setTcSuccess(true);
+      } else {
+    	  tr0.appendTcDetail("The Portlet Mode is null");
+      }
        tr0.writeTo(writer);
 
       /* TestCase: V2PortletTests_PortletMode_ApiRender_constructor2          */
       /* Details: "The constructor PortletMode(java.lang.String): converts    */
       /* any upper case letters in the name parameter to lower case"          */
       TestResult tr1 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETMODE_APIRENDER_CONSTRUCTOR2);
-      /* TODO: implement test */
-      tr1.appendTcDetail("Not implemented.");
+      WindowState ws1=new WindowState("NEWMODE");
+      if(ws1!=null && ws1.toString().equals("newmode")) {
+    	  tr1.setTcSuccess(true);
+      } else {
+    	  tr1.appendTcDetail("The Portlet Mode is null");
+      }
       tr1.writeTo(writer);
 
       /* TestCase: V2PortletTests_PortletMode_ApiRender_fieldEDIT             */
@@ -151,37 +159,38 @@ public class PortletTests_PortletMode_ApiRender implements Portlet,
ResourceServ
       /* Details: "Method toString(): Returns a String representation of      */
       /* the portlet mode"                                                    */
       TestResult tr5 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETMODE_APIRENDER_TOSTRING);
-      try {
-          String name = "toString";
-          Class<?> retType = String.class;
-          Class<?>[] parms = null;
-          tr5.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr5.appendTcDetail(e.toString());}
+      String tstring=mode.toString();
+      if(tstring.equals("view")) {
+    	  tr5.setTcSuccess(true);
+      } else {
+          tr5.appendTcDetail("String Representation of Portlet Mode: "+mode.toString());
 
+         }
        tr5.writeTo(writer);
+      
 
       /* TestCase: V2PortletTests_PortletMode_ApiRender_hashCode              */
       /* Details: "Method hashCode(): Returns an int containing the has       */
       /* code for the portlet mode"                                           */
-      TestResult tr6 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETMODE_APIRENDER_HASHCODE);
-      try {
-          String name = "hashCode";
-          Class<?> retType = int.class;
-          Class<?>[] parms = null;
-          tr6.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr6.appendTcDetail(e.toString());}
+      TestResult tr6 = tcd.getTestResultSucceeded(V2PORTLETTESTS_PORTLETMODE_APIRENDER_HASHCODE);
+      Object hcode=mode.hashCode();
+      if(!hcode.equals(hcode)) {
+    	  tr6.setTcSuccess(true);
+    	  tr6.appendTcDetail("hashCode code value for Portlet Mode: "+hcode.toString());
+       }
        tr6.writeTo(writer);
+      
 
       /* TestCase: V2PortletTests_PortletMode_ApiRender_equals                */
       /* Details: "Method equals(): Returns true if the PortletMode equals    */
       /* the specified PortletMode"                                           */
       TestResult tr7 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLETMODE_APIRENDER_EQUALS);
-      try {
-          String name = "equals";
-          Class<?> retType = boolean.class;
-          Class<?>[] parms = {Object.class};
-          tr7.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr7.appendTcDetail(e.toString());}
-       tr7.writeTo(writer);
+      Object obj=portletReq.getPortletMode();
+      if(obj instanceof PortletMode) {
+    	  tr7.setTcSuccess(true);
+      }  else {
+    		  tr7.appendTcDetail("The PortletMode does not equals the expected value"+obj.toString());
+      }
+      tr7.writeTo(writer);
    }
 
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Portlet_ApiAction.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Portlet_ApiAction.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Portlet_ApiAction.java
index 8aff793..5fd0492 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Portlet_ApiAction.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Portlet_ApiAction.java
@@ -83,10 +83,13 @@ public class PortletTests_Portlet_ApiAction implements Portlet, ResourceServingP
       /* called when an action URL for the portlet is triggered"              */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_PORTLET_APIACTION_PROCESSACTION);
       try {
-          String name = "processAction";
-          Class<?> retType = void.class;
-          Class<?>[] parms = {ActionRequest.class, ActionResponse.class};
-          tr0.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
+    	  String val=portletReq.getAuthType();
+    	  if(val.equals("FORM")) {
+    		  tr0.setTcSuccess(true);
+    	  }else {
+    		  tr0.appendTcDetail("The Authentication type is null or incorrect"); 
+    	  }
+    	  
        } catch(Exception e) {tr0.appendTcDetail(e.toString());}
        tr0.writeTo(writer);
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
index de0ad2d..98cd77e 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_ResourceServingPortlet_ApiResource.java
@@ -94,14 +94,7 @@ public class PortletTests_ResourceServingPortlet_ApiResource implements
Portlet,
       /* Details: "Method serveResource(ResourceRequest, ResourceResponse):   */
       /* is called to allow the portlet to generate resource content "        */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_RESOURCESERVINGPORTLET_APIRESOURCE_SERVERESOURCE);
-      try {
-          String name = "serveResource";
-          Class<?> retType = void.class;
-          Class<?>[] parms = {ResourceRequest.class, ResourceResponse.class};
-          tr0.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr0.appendTcDetail(e.toString());}
-       tr0.writeTo(writer);
-
+      
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_WindowState_ApiRender.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_WindowState_ApiRender.java
b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_WindowState_ApiRender.java
index 6560eb1..2718e9c 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_WindowState_ApiRender.java
+++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_WindowState_ApiRender.java
@@ -95,9 +95,10 @@ public class PortletTests_WindowState_ApiRender implements Portlet, ResourceServ
       portletReq.setAttribute(THREADID_ATTR, tid);
 
       PrintWriter writer = portletResp.getWriter();
-
+      
       JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails();
-
+      
+      WindowState state=portletReq.getWindowState();
       // Create result objects for the tests
 
       ClassChecker cc = new ClassChecker(portletReq.getWindowState().getClass());
@@ -106,19 +107,25 @@ public class PortletTests_WindowState_ApiRender implements Portlet,
ResourceServ
       /* Details: "The constructor WindowState(java.lang.String): allows a    */
       /* WindowState object of the specified name to be constructed"          */
       TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_WINDOWSTATE_APIRENDER_CONSTRUCTOR1);
-      try {
-          Class<?>[] parms = {String.class};
-          tr0.setTcSuccess(cc.hasConstructor(parms));
-       } catch(Exception e) {tr0.appendTcDetail(e.toString());}
+      WindowState ws=new WindowState("newstate");
+      if(ws!=null && ws.toString().equals("newstate")) {
+    	  tr0.setTcSuccess(true);
+      } else {
+    	  tr0.appendTcDetail("The Window State is null");
+      }
        tr0.writeTo(writer);
 
       /* TestCase: V2PortletTests_WindowState_ApiRender_constructor2          */
       /* Details: "The constructor WindowState(java.lang.String): converts    */
       /* any upper case letters in the name parameter to lower case"          */
       TestResult tr1 = tcd.getTestResultFailed(V2PORTLETTESTS_WINDOWSTATE_APIRENDER_CONSTRUCTOR2);
-      /* TODO: implement test */
-      tr1.appendTcDetail("Not implemented.");
-      tr1.writeTo(writer);
+      WindowState ws1=new WindowState("NEWSTATE");
+      if(ws1!=null && ws1.toString().equals("newstate")) {
+    	  tr1.setTcSuccess(true);
+      } else {
+    	  tr1.appendTcDetail("The Window State is null");
+      }
+       tr1.writeTo(writer);
 
       /* TestCase: V2PortletTests_WindowState_ApiRender_fieldMAXIMIZED        */
       /* Details: "Has WindowState field MAXIMIZED with value of              */
@@ -149,40 +156,44 @@ public class PortletTests_WindowState_ApiRender implements Portlet,
ResourceServ
 
       /* TestCase: V2PortletTests_WindowState_ApiRender_toString              */
       /* Details: "Method toString(): Returns a String representation of      */
-      /* the portlet mode"                                                    */
+      /* the Window State"                                                    */
       TestResult tr5 = tcd.getTestResultFailed(V2PORTLETTESTS_WINDOWSTATE_APIRENDER_TOSTRING);
-      try {
-          String name = "toString";
-          Class<?> retType = String.class;
-          Class<?>[] parms = null;
-          tr5.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr5.appendTcDetail(e.toString());}
+      String tstring=state.toString();
+      if(tstring.equals("normal")) {
+    	  tr5.setTcSuccess(true);
+      } else {
+          tr5.appendTcDetail("String Representation of Window State: "+state.toString());
 
+         }
        tr5.writeTo(writer);
 
       /* TestCase: V2PortletTests_WindowState_ApiRender_hashCode              */
       /* Details: "Method hashCode(): Returns an int containing the has       */
-      /* code for the portlet mode"                                           */
-      TestResult tr6 = tcd.getTestResultFailed(V2PORTLETTESTS_WINDOWSTATE_APIRENDER_HASHCODE);
-      try {
-          String name = "hashCode";
-          Class<?> retType = int.class;
-          Class<?>[] parms = null;
-          tr6.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr6.appendTcDetail(e.toString());}
+      /* code for the Window State"                                           */
+      TestResult tr6 = tcd.getTestResultSucceeded(V2PORTLETTESTS_WINDOWSTATE_APIRENDER_HASHCODE);
+      Object hcode=state.hashCode();
+      if(!hcode.equals(hcode)) {
+    	  tr6.setTcSuccess(true);
+    	  tr6.appendTcDetail("hashCode code value for Window State: "+hcode.toString());
+       }
        tr6.writeTo(writer);
 
       /* TestCase: V2PortletTests_WindowState_ApiRender_equals                */
       /* Details: "Method equals(): Returns true if the WindowState equals    */
       /* the specified WindowState"                                           */
       TestResult tr7 = tcd.getTestResultFailed(V2PORTLETTESTS_WINDOWSTATE_APIRENDER_EQUALS);
-      try {
-          String name = "equals";
-          Class<?> retType = boolean.class;
-          Class<?>[] parms = {Object.class};
-          tr7.setTcSuccess(cc.methodHasReturnType(name, retType, parms));
-       } catch(Exception e) {tr7.appendTcDetail(e.toString());}
+      Object obj=portletReq.getWindowState();
+      if(obj instanceof WindowState) {
+    	  tr7.setTcSuccess(true);
+      }  else {
+    		  tr7.appendTcDetail("The WindowState does not equals the expected state"+obj.toString());
+      }
        tr7.writeTo(writer);
 
    }
 
+private void WindowState() {
+	// TODO Auto-generated method stub
+	
+}
+
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml b/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
index 2a4c37e..b5767a3 100644
--- a/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
+++ b/portlet-tck_3.0/V2PortletTests/src/main/webapp/WEB-INF/portlet.xml
@@ -73,9 +73,8 @@
       </supports>
       <portlet-info>
          <title>PortletTests_PortletConfig_ApiRender2</title>
-      </portlet-info>
-   
-      </portlet>
+      </portlet-info> 
+    </portlet>
 
    <portlet>
       <portlet-name>PortletTests_PortletMode_ApiRender</portlet-name>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/V2RequestTests/src/main/java/javax/portlet/tck/portlets/RequestTests_PortletRequest_ApiRender.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2RequestTests/src/main/java/javax/portlet/tck/portlets/RequestTests_PortletRequest_ApiRender.java
b/portlet-tck_3.0/V2RequestTests/src/main/java/javax/portlet/tck/portlets/RequestTests_PortletRequest_ApiRender.java
index a3f1ace..e4014b0 100644
--- a/portlet-tck_3.0/V2RequestTests/src/main/java/javax/portlet/tck/portlets/RequestTests_PortletRequest_ApiRender.java
+++ b/portlet-tck_3.0/V2RequestTests/src/main/java/javax/portlet/tck/portlets/RequestTests_PortletRequest_ApiRender.java
@@ -329,7 +329,7 @@ public class RequestTests_PortletRequest_ApiRender implements Portlet,
ResourceS
       /* Details: "Method getPortletSession(): Returns current                */
       /* PortletSession if one already exists"                                */
       TestResult tr22 = tcd.getTestResultFailed(V2REQUESTTESTS_PORTLETREQUEST_APIRENDER_GETPORTLETSESSIONA1);
-      PortletSession ps=portletReq.getPortletSession();
+      
       
       tr22.writeTo(writer);
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/beans/TestButton.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/beans/TestButton.java
b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/beans/TestButton.java
index 54b8fb7..049b194 100644
--- a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/beans/TestButton.java
+++ b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/beans/TestButton.java
@@ -96,7 +96,7 @@ public class TestButton {
     */
    @Override
    public String toString() {
-      final String actId = tcName + Constants.CLICK_ID;
+      final String actId = tcName + Constants.CLICK_ID ;
       
       if (urlstr == null) urlstr = purl.toString();
       StringBuilder sb = new StringBuilder();
@@ -109,7 +109,10 @@ public class TestButton {
       sb.append("</h4>");
       sb.append("<form  class='portletTCKButton'" +
                 " action='" + urlstr + "' method='post'>");
-      sb.append("<input type='submit' value='" + tcName + "'  id='" + actId + "'/>");
+      sb.append("<input type='submit' value='").append(tcName);
+      sb.append("'  name='").append(Constants.BUTTON_PARAM_NAME);
+      sb.append("'  id='").append(actId);
+      sb.append("'/>");
       sb.append("</form>");
       sb.append("</div>");
 

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/5602490c/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/constants/Constants.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/constants/Constants.java
b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/constants/Constants.java
index 2307cfb..10e5389 100644
--- a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/constants/Constants.java
+++ b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/constants/Constants.java
@@ -32,6 +32,7 @@ public class Constants {
    public static final String RESOURCE_DIV_ID = "-resdiv";
    public static final String SUCCESS = "Succeeded";
    public static final String FAILURE = "Failed";
+   public static final String BUTTON_PARAM_NAME="inputval";
    
    // for session attributes passing info between phases
    public static final String RESULT_ATTR_PREFIX = "attr.result.";


Mime
View raw message