public void testBuildSegmentRowReaderSuper() throws Exception {
SelectQuery query = new SelectQuery(AbstractPerson.class);
EntityResolver resolver = getDomain().getEntityResolver();
QueryMetadata md = query.getMetaData(resolver);
ClassDescriptor descriptor = md.getClassDescriptor();
ExtendedTypeMap converters = getDomain()
.getDataNodes()
.iterator()
.next()
.getAdapter()
.getExtendedTypes();
SelectDescriptor<Object> select = new EntityTreeSegmentBuilder(
md,
converters,
descriptor).buildSegment();
List<? extends SelectColumn> columns = select.getColumns();
Map<String, Object> employeeRowMap = new HashMap<String, Object>();
employeeRowMap.put("PERSON_ID", 1);
employeeRowMap.put("PERSON_TYPE", "EE");
employeeRowMap.put("NAME", "E1");
employeeRowMap.put("SALARY", new Float(1.0));
employeeRowMap.put("DEPARTMENT_ID", 1);
Map<String, Object> managerRowMap = new HashMap<String, Object>();
managerRowMap.put("PERSON_ID", 2);
managerRowMap.put("PERSON_TYPE", "EM");
managerRowMap.put("NAME", "E2");
managerRowMap.put("SALARY", new Float(2.0));
managerRowMap.put("DEPARTMENT_ID", 2);
Map<String, Object> crRowMap = new HashMap<String, Object>();
crRowMap.put("PERSON_ID", 3);
crRowMap.put("PERSON_TYPE", "C");
crRowMap.put("NAME", "E2");
crRowMap.put("CLIENT_CONTACT_TYPE", "XX");
crRowMap.put("CLIENT_COMPANY_ID", 3);
List<Object> employeeRow = new ArrayList<Object>();
List<Object> managerRow = new ArrayList<Object>();
List<Object> crRow = new ArrayList<Object>();
MockResultSet rs = new MockResultSet("test");
for (SelectColumn column : columns) {
rs.addColumn(column.getColumnName(md.getDbEntity(), null));
employeeRow.add(employeeRowMap.get(column.getDataRowKey()));
managerRow.add(managerRowMap.get(column.getDataRowKey()));
crRow.add(crRowMap.get(column.getDataRowKey()));
}