object.setPTextAsString("Hello, world!");
object.setPBoolean(true);
object.setPDate(new Date(2011, 5, 2));
object.setPDatetime(new DateTime(2011, 12, 31, 23, 59, 59));
DataModelReflection ref = def.toReflection(object);
assertThat(ref.getValue(p("p_int")), is((Object) 100));
assertThat(ref.getValue(p("p_long")), is((Object) 200L));
assertThat(ref.getValue(p("p_byte")), is((Object) (byte) 127));
assertThat(ref.getValue(p("p_short")), is((Object) (short) 300));
assertThat(ref.getValue(p("p_float")), is((Object) 1.5f));
assertThat(ref.getValue(p("p_double")), is((Object) 2.5d));
assertThat(ref.getValue(p("p_decimal")), is((Object) new BigDecimal("3.141592")));
assertThat(ref.getValue(p("p_text")), is((Object) "Hello, world!"));
assertThat(ref.getValue(p("p_boolean")), is((Object) true));
Calendar date = (Calendar) ref.getValue(p("p_date"));
assertThat(new SimpleDateFormat("yyyy/MM/dd").format(date.getTime()), is("2011/05/02"));
Calendar datetime = (Calendar) ref.getValue(p("p_datetime"));
assertThat(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(datetime.getTime()), is("2011/12/31 23:59:59"));
}