Example #1
0
  public void testSupportSerializableDataType() throws Exception {
    SerializedObject value = new SerializedObject();
    value.value = 5;

    test = EntityPropertyTest.FACTORY.initInstance("test1");
    test.putIfAbsent();
    EntityPropertyImpl<EntityPropertyTest, SerializedObject> prop =
        new EntityPropertyImpl<EntityPropertyTest, SerializedObject>(
            test.getEntityBasePropertyAccess(),
            SerializedObject.class,
            "serializable",
            SerializableDataTypeTranslatorImpl.getInstance(SerializedObject.class),
            true);

    prop.set(value);
    test.put();
    prop =
        new EntityPropertyImpl<EntityPropertyTest, SerializedObject>(
            test.getEntityBasePropertyAccess(),
            SerializedObject.class,
            "serializable",
            SerializableDataTypeTranslatorImpl.getInstance(SerializedObject.class),
            true);

    assertEquals(value, SerializedObject.class.cast(prop.get()));
  }
Example #2
0
 public void testSerialized() throws Exception {
   SerializedObject value = new SerializedObject();
   value.value = 5;
   checkPropertyType(SerializedObject.class, value);
 }