public void testInheritancePrimaryKeys() throws Exception {
root = loadAndInfer(UserRoles.class);
Role guest = assertHasRole(root, "User");
DomainAttribute source_id = assertHasDomainAttribute(guest, "generated primary key");
assertGenerated(source_id);
Role role = assertHasRole(root, "default role");
DomainAttribute id = assertHasDomainAttribute(role, "generated primary key");
assertGenerated(id);
DomainAttribute fk = assertHasDomainAttribute(role, "User.generated primary key");
assertGenerated(fk);
// there should be an extends wire between the PK and FK
assertGenerated(assertHasExtendsEdge(root, fk, source_id));
// and none between the PK and PK
assertHasNoExtendsEdge(root, id, source_id);
assertHasNoExtendsEdge(root, source_id, id);
// check the types of the keys
assertEqualType(BuiltinDataTypes.getTypeInteger(), ((EXSDDataType) id.getEType()).getDefinition());
assertEqualType(id, fk);
assertEqualType(BuiltinDataTypes.getTypeInteger(), ((EXSDDataType) fk.getEType()).getDefinition());
}