This commit is contained in:
Keith Donald
2009-11-04 17:07:25 +00:00
parent 0a78287a8f
commit ffbfa2992c
7 changed files with 421 additions and 190 deletions

View File

@@ -41,7 +41,7 @@ import org.springframework.ui.format.number.IntegerFormatter;
* @author Keith Donald
* @author Juergen Hoeller
*/
public class GenericFormattingServiceTests {
public class FormattingConversionServiceTests {
private FormattingConversionService formattingService;
@@ -93,6 +93,7 @@ public class GenericFormattingServiceTests {
}
});
formattingService.addFormatterForFieldAnnotation(new DateTimeFormatAnnotationFormatterFactory());
System.out.println(this.formattingService);
String formatted = (String) formattingService.convert(new LocalDate(2009, 10, 31).toDateTimeAtCurrentTime()
.toDate(), new TypeDescriptor(Model.class.getField("date")), TypeDescriptor.valueOf(String.class));
assertEquals("10/31/09", formatted);