git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2249 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2009-11-04 17:07:25 +00:00
parent c8d2353322
commit 4aafe47a52
7 changed files with 421 additions and 190 deletions
@@ -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);