/**
* Test for CAY-1008: Reverse relationships may not be correctly set if inheritance is
* used.
*/
public void testCAY1008() {
RelatedEntity related = context.newObject(RelatedEntity.class);
BaseEntity base = context.newObject(BaseEntity.class);
base.setToRelatedEntity(related);
assertEquals(1, related.getBaseEntities().size());
assertEquals(0, related.getSubEntities().size());
SubEntity sub = context.newObject(SubEntity.class);
sub.setToRelatedEntity(related);
assertEquals(2, related.getBaseEntities().size());
// TODO: andrus 2008/03/28 - this fails...
// assertEquals(1, related.getSubEntities().size());
}