use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class JodaTimeFormattingTests method testBindInstantAnnotated.
@Test
public void testBindInstantAnnotated() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("instantAnnotated", "2009-10-31T12:00:00.000Z");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertEquals("2009-10-31T07:00:00.000-05:00", binder.getBindingResult().getFieldValue("instantAnnotated"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class DateFormattingTests method testBindDateAnnotated.
@Test
public void testBindDateAnnotated() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("dateAnnotated", "10/31/09");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertEquals("10/31/09", binder.getBindingResult().getFieldValue("dateAnnotated"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class DateFormattingTests method testBindDateAnnotatedWithFallbackError.
@Test
@Ignore
public void testBindDateAnnotatedWithFallbackError() {
// TODO This currently passes because of the Date(String) constructor fallback is used
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("dateAnnotated", "Oct 031, 2009");
binder.bind(propertyValues);
assertEquals(1, binder.getBindingResult().getFieldErrorCount("dateAnnotated"));
assertEquals("Oct 031, 2009", binder.getBindingResult().getFieldValue("dateAnnotated"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class DateFormattingTests method testBindDateAnnotatedWithError.
@Test
public void testBindDateAnnotatedWithError() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("dateAnnotated", "Oct X31, 2009");
binder.bind(propertyValues);
assertEquals(1, binder.getBindingResult().getFieldErrorCount("dateAnnotated"));
assertEquals("Oct X31, 2009", binder.getBindingResult().getFieldValue("dateAnnotated"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class DateFormattingTests method testBindCalendarAnnotated.
@Test
public void testBindCalendarAnnotated() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("calendarAnnotated", "10/31/09");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertEquals("10/31/09", binder.getBindingResult().getFieldValue("calendarAnnotated"));
}
Aggregations