click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1035174 - /click/trunk/click/framework/test/org/apache/click/control/CheckboxTest.java
Date Mon, 15 Nov 2010 08:23:40 GMT
Author: sabob
Date: Mon Nov 15 08:23:39 2010
New Revision: 1035174

URL: http://svn.apache.org/viewvc?rev=1035174&view=rev
Log:
added checkbox test to ensure it is unchecked if there is no incoming request parameter

Modified:
    click/trunk/click/framework/test/org/apache/click/control/CheckboxTest.java

Modified: click/trunk/click/framework/test/org/apache/click/control/CheckboxTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/control/CheckboxTest.java?rev=1035174&r1=1035173&r2=1035174&view=diff
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/control/CheckboxTest.java (original)
+++ click/trunk/click/framework/test/org/apache/click/control/CheckboxTest.java Mon Nov 15
08:23:39 2010
@@ -202,4 +202,25 @@ public class CheckboxTest extends TestCa
         field.setValueObject(true);
         assertTrue(field.isChecked());
     }
+
+    /**
+     * Coverage test of onProcess for an unchecked Checkbox.
+     */
+    public void testUncheckedOnProcess() {
+        MockContext.initContext();
+
+        Checkbox field = new Checkbox("field");
+
+        // Initially checkbox is checked
+        field.setChecked(true);
+
+        assertTrue(field.isChecked());
+
+        // Note, no request parameter for the checkbox has been set, so it should
+        // be unchecked
+        field.onProcess();
+
+        // Check that checkbox hs been unchecked
+        assertFalse(field.isChecked());
+    }
 }



Mime
View raw message