testCreateAndFindParentAndChildren(NEW_EM_START_END);
}
@SuppressWarnings("unchecked")
private void testCreateAndFindParentAndChildren(StartEnd startEnd) throws Exception {
// create Parent
Parent p = newParent(startEnd, "Parent");
Long pId = p.getId();
Key pKey = KeyFactory.createKey(PARENT_KIND, pId);
// verify Parent entity
Entity pe = ds.get(pKey);
Assert.assertEquals(pKey, pe.getKey());
Assert.assertEquals("P", pe.getProperty("DTYPE"));
Assert.assertEquals("Parent", pe.getProperty("parentStr"));
Assert.assertEquals(2, pe.getProperties().size());
// verify Parent object
startEnd.start();
p = em.find(Parent.class, pId);
Assert.assertEquals(pId, p.getId());
Assert.assertEquals("Parent", p.getParentStr());
startEnd.end();
// create Child11
Child11 c11 = newChild11(startEnd, "Child11", 11);
Long c11Id = c11.getId();