* Test method for {@link DefaultDataModelDefinition#toReflection(java.lang.Object)}.
*/
@Test
public void toReflection() {
DefaultDataModelDefinition<Variety> def = new DefaultDataModelDefinition<Variety>(Variety.class);
Variety object = new Variety();
object.setPInt(100);
object.setPLong(200);
object.setPByte((byte) 127);
object.setPShort((short) 300);
object.setPFloat(1.5f);
object.setPDouble(2.5d);
object.setPDecimal(new BigDecimal("3.141592"));
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));