Date value = (Date)field.clean(new String[]{"12/15/08 8:43"}, errors);
assertEquals(expected.getTime(), value);
}
public void testNoDigitYear() throws Exception {
Field field = injector.getInstance(DateField.class);
field.setName("fieldName");
Map<String, String> errors = new HashMap<String, String>();
Calendar expected = new GregorianCalendar();
expected.set(Calendar.MONTH, 11);
expected.set(Calendar.DAY_OF_MONTH, 15);
expected.set(Calendar.HOUR_OF_DAY, 0);
expected.set(Calendar.MINUTE, 0);
expected.set(Calendar.SECOND, 0);
expected.set(Calendar.MILLISECOND, 0);
Date value = (Date)field.clean(new String[]{"12/15"}, errors);
assertEquals(expected.getTime(), value);
}