Package javango.forms.fields

Examples of javango.forms.fields.CharField


import junit.framework.TestCase;

public class NullFieldTest extends InjectedTestCaseBase {

  public void testNoAllowNull() throws Exception {
    Field field = new CharField(injector.getInstance(WidgetFactory.class)).setRequired(false).setAllowNull(false);
    field.setName("fieldName");
   
    Map<String, String> errors = new HashMap<String, String>();
   
    String value = (String)field.clean(new String[]{""}, errors);
View Full Code Here


    String value = (String)field.clean(new String[]{""}, errors);
    assertTrue(errors.isEmpty());
    assertTrue("".equals(value));
  }
  public void testAllowNull() throws Exception {
    Field field = new CharField(injector.getInstance(WidgetFactory.class)).setRequired(false).setAllowNull(true);
    field.setName("fieldName");
   
    Map<String, String> errors = new HashMap<String, String>();
   
    String value = (String)field.clean(new String[]{""}, errors);
View Full Code Here

TOP

Related Classes of javango.forms.fields.CharField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.