import javango.forms.widgets.WidgetFactory;
public class IntegerFieldTest extends InjectedTestCaseBase {
public void testRequired() throws Exception {
Field field = new IntegerField(injector.getInstance(WidgetFactory.class));
field.setName("fieldName");
Map<String, String> errors = new HashMap<String, String>();
Long value = (Long)field.clean(new String[]{""}, errors);
assertFalse(errors.isEmpty());
assertTrue(errors.containsKey(field.getName()));
assertEquals("Required", errors.get(field.getName()));
// Integer number not valid
}