myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r926393 - /myfaces/core/trunk/api/src/test/java/javax/faces/component/UIViewParameterTest.java
Date Mon, 22 Mar 2010 23:13:46 GMT
Author: jakobk
Date: Mon Mar 22 23:13:46 2010
New Revision: 926393

URL: http://svn.apache.org/viewvc?rev=926393&view=rev
Log:
MYFACES-2592 UIViewParameter.decode() should set the submitted value only if it is not null
(added test case)

Modified:
    myfaces/core/trunk/api/src/test/java/javax/faces/component/UIViewParameterTest.java

Modified: myfaces/core/trunk/api/src/test/java/javax/faces/component/UIViewParameterTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/test/java/javax/faces/component/UIViewParameterTest.java?rev=926393&r1=926392&r2=926393&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/test/java/javax/faces/component/UIViewParameterTest.java (original)
+++ myfaces/core/trunk/api/src/test/java/javax/faces/component/UIViewParameterTest.java Mon
Mar 22 23:13:46 2010
@@ -69,5 +69,22 @@ public class UIViewParameterTest extends
         viewParameter.processValidators(facesContext);
         assertTrue(facesContext.isValidationFailed());
     }
+    
+    /**
+     * Tests if UIViewParameter.decode() sets the submitted value only if it is not null.
+     */
+    @SuppressWarnings("unchecked")
+    public void testDecodeSetOnlyNonNullSubmittedValue()
+    {
+        final String notNull = "not null";
+        viewParameter.setSubmittedValue(notNull);
+        
+        // explicitly set the value in the request parameter map to null
+        externalContext.getRequestParameterMap().put(viewParameter.getName(), null);
+        
+        viewParameter.decode(facesContext);
+        
+        assertEquals(viewParameter.getSubmittedValue(), notNull);
+    }
 
 }



Mime
View raw message