You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/03/18 18:39:32 UTC

svn commit: r924914 - in /myfaces/portlet-bridge/testsuite/trunk/src/main: java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_1_3_1/ java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_6/ webapp/tests/

Author: mfreedman
Date: Thu Mar 18 17:39:32 2010
New Revision: 924914

URL: http://svn.apache.org/viewvc?rev=924914&view=rev
Log:
Modified test that verifies consistent encoding of namespace in UIViewRoot to work properly,  fixed some spelling mistakes, and other minor things

Modified:
    myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_1_3_1/Tests.java
    myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_6/Tests.java
    myfaces/portlet-bridge/testsuite/trunk/src/main/webapp/tests/chapter6_5.jsp

Modified: myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_1_3_1/Tests.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_1_3_1/Tests.java?rev=924914&r1=924913&r2=924914&view=diff
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_1_3_1/Tests.java (original)
+++ myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_1_3_1/Tests.java Thu Mar 18 17:39:32 2010
@@ -1448,13 +1448,13 @@ public class Tests
       if (extCtx.getRequest() == aRequest)
       {
         testRunner.setTestResult(true,
-                                 "Successfully set/retrieved a new ActionRequest using ExternalContxt.set/getRequest.");
+                                 "Successfully set/retrieved a new ActionRequest using ExternalContext.set/getRequest.");
         return "getSetRequestObjectTest"; // action Navigation result
       }
       else
       {
         testRunner.setTestResult(false,
-                                 "ExternalContxt.set/getRequest a new ActionRequest failed as the retrieved object isn't the same as the one set.");
+                                 "ExternalContext.set/getRequest a new ActionRequest failed as the retrieved object isn't the same as the one set.");
         return "getSetRequestObjectTest";
       }
     }
@@ -1469,7 +1469,7 @@ public class Tests
       extCtx.setRequest(rRequest);
       if (extCtx.getRequest() == rRequest)
       {
-        testRunner.appendTestDetail("Successfully set/retrieved a new RenderRequest using ExternalContxt.set/getRequest.");
+        testRunner.appendTestDetail("Successfully set/retrieved a new RenderRequest using ExternalContext.set/getRequest.");
         return Constants.TEST_SUCCESS;
       }
       else

Modified: myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_6/Tests.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_6/Tests.java?rev=924914&r1=924913&r2=924914&view=diff
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_6/Tests.java (original)
+++ myfaces/portlet-bridge/testsuite/trunk/src/main/java/org/apache/myfaces/portlet/faces/testsuite/tests/chapter_6/section_6_6/Tests.java Thu Mar 18 17:39:32 2010
@@ -102,16 +102,26 @@ public class Tests
       
       // Values set by portlet at end of action
       String clientIdInAction = (String) extCtx.getRequestMap().get("org.apache.myfaces.portlet.faces.tck.clientIdInAction");
-      if (clientIdInAction.equals(clientId))
+      String namespace = ((RenderResponse) ctx.getExternalContext().getResponse()).getNamespace();
+      
+      if (clientId.indexOf(namespace) < 0)
+      {
+        testRunner.setTestResult(false,  
+                                 "UIViewRoot getClientContainerId doesn not includes the portlet namespace id.");
+        return Constants.TEST_FAILED;
+      }
+      
+      
+      if (clientIdInAction.indexOf(namespace) >= 0)
       {
         testRunner.setTestResult(true,
-                                "getContainerClientId returned the same result in both the action and the render.");
+                                "getContainerClientId encoded the same namespace in both the action and the render.");
         return Constants.TEST_SUCCESS;
       }
       else
       {
         testRunner.setTestResult(false,
-                                 "getContainerClientId returned a different result between an action and the render.  In action: "
+                                 "getContainerClientId returned a different namespace encoding between an action and the render.  ClientId action: "
                                  + clientIdInAction + " while in render: " + clientId);
         return Constants.TEST_FAILED;
       }

Modified: myfaces/portlet-bridge/testsuite/trunk/src/main/webapp/tests/chapter6_5.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/testsuite/trunk/src/main/webapp/tests/chapter6_5.jsp?rev=924914&r1=924913&r2=924914&view=diff
==============================================================================
--- myfaces/portlet-bridge/testsuite/trunk/src/main/webapp/tests/chapter6_5.jsp (original)
+++ myfaces/portlet-bridge/testsuite/trunk/src/main/webapp/tests/chapter6_5.jsp Thu Mar 18 17:39:32 2010
@@ -211,6 +211,7 @@
   {
     status = false;
     detail += "JSF EL resolution of implict variable 'facesContext' failed<br>";
+    elFacesContext = FacesContext.getCurrentInstance();
   }
   
   UIViewRoot elView = (UIViewRoot) pageContext.getAttribute("tck_view");
@@ -247,7 +248,7 @@
   if (elPortletPreferences == null || !testImplicitObject(elPortletPreferences, ((PortletRequest)elFacesContext.getExternalContext().getRequest()).getPreferences()))
   {
     status = false;
-    detail += "JSF EL resolution of implict variable 'portletSessionScope' failed<br>";
+    detail += "JSF EL resolution of implict variable 'portletPreferences' failed<br>";
   }
   
   Map<String, String[]> elPortletPreferencesValues = (Map<String, String[]>) pageContext.getAttribute("tck_portletPreferencesValues");