}
@Test
public void testCustomPropertyEncoder() throws Exception
{
ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
LongEncodedEntity e = new LongEncodedEntity();
Key key = oss.store(e).now();
Point orig = e.p;
Long l = new PointLongEncoder().encode(orig);
e.p = null;
oss.refresh(e).now();
assertEquals(orig, e.p);
Entity ent = DatastoreServiceFactory.getDatastoreService().get(key);
assertEquals(l, ent.getProperty("p"));
}