diff --git a/org.springframework.context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java b/org.springframework.context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java index b1d1fbd21be..214ec1b708a 100644 --- a/org.springframework.context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java +++ b/org.springframework.context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java @@ -151,6 +151,16 @@ public class JodaTimeFormattingTests { "localDateTimeAnnotated")); } + @Test + public void testBindLocalDateTimeAnnotatedLong() { + MutablePropertyValues propertyValues = new MutablePropertyValues(); + propertyValues.add("localDateTimeAnnotatedLong", "October 31, 2009 12:00:00 PM "); + binder.bind(propertyValues); + assertEquals(0, binder.getBindingResult().getErrorCount()); + assertEquals("October 31, 2009 12:00:00 PM ", binder.getBindingResult().getFieldValue( + "localDateTimeAnnotatedLong")); + } + @Test public void testBindDateTime() { MutablePropertyValues propertyValues = new MutablePropertyValues(); @@ -287,6 +297,9 @@ public class JodaTimeFormattingTests { @DateTimeFormat(style="FF") private LocalDateTime localDateTimeAnnotated; + @DateTimeFormat(style="LL") + private LocalDateTime localDateTimeAnnotatedLong; + private DateTime dateTime; @DateTimeFormat(style="MS") @@ -371,6 +384,14 @@ public class JodaTimeFormattingTests { public void setLocalDateTimeAnnotated(LocalDateTime localDateTimeAnnotated) { this.localDateTimeAnnotated = localDateTimeAnnotated; } + + public LocalDateTime getLocalDateTimeAnnotatedLong() { + return localDateTimeAnnotatedLong; + } + + public void setLocalDateTimeAnnotatedLong(LocalDateTime localDateTimeAnnotatedLong) { + this.localDateTimeAnnotatedLong = localDateTimeAnnotatedLong; + } public DateTime getDateTime() { return dateTime;