use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class JodaTimeFormattingTests method testBindLocalTimeWithSpecificFormatter.
@Test
public void testBindLocalTimeWithSpecificFormatter() throws Exception {
JodaTimeFormatterRegistrar registrar = new JodaTimeFormatterRegistrar();
registrar.setTimeFormatter(org.joda.time.format.DateTimeFormat.forPattern("HHmmss"));
setUp(registrar);
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("localTime", "130000");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertEquals("130000", binder.getBindingResult().getFieldValue("localTime"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class JodaTimeFormattingTests method testBindMutableDateTimeAnnotated.
@Test
public void testBindMutableDateTimeAnnotated() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("mutableDateTimeAnnotated", "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("mutableDateTimeAnnotated"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class JodaTimeFormattingTests method testBindDuration.
@Test
public void testBindDuration() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("duration", "PT72.345S");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertTrue(binder.getBindingResult().getFieldValue("duration").toString().equals("PT72.345S"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class JodaTimeFormattingTests method testBindLocalTime.
@Test
public void testBindLocalTime() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("localTime", "12:00 PM");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertEquals("12:00 PM", binder.getBindingResult().getFieldValue("localTime"));
}
use of org.springframework.beans.MutablePropertyValues in project spring-framework by spring-projects.
the class JodaTimeFormattingTests method testBindLong.
@Test
public void testBindLong() {
MutablePropertyValues propertyValues = new MutablePropertyValues();
propertyValues.add("millis", "1256961600");
binder.bind(propertyValues);
assertEquals(0, binder.getBindingResult().getErrorCount());
assertEquals("1256961600", binder.getBindingResult().getFieldValue("millis"));
}
Aggregations