}
assertEquals(2, cInfos.size());
for (int i = 0; i < cInfos.size(); ++i) {
ClassInfo cInfo = (ClassInfo) cInfos.get(i);
assertNotNull(cInfo);
JDOClassInfoNature cNature = new JDOClassInfoNature(cInfo);
XMLInfoNature xmlNature = new XMLInfoNature(cInfo);
assertNotNull(cNature);
if (xmlNature.getNodeName().equals("person")) {
String tableName = cNature.getTableName();
assertEquals("person", tableName);
List primaryKeys = cNature.getPrimaryKeys();
assertEquals(1, primaryKeys.size());
assertEquals("ssn", (String) primaryKeys.get(0));
assertEquals(4, cInfo.getFieldCount());
FieldInfo[] fInfos = cInfo.getElementFields();
assertNotNull(fInfos);
for (int j = 0; j < fInfos.length; ++j) {
FieldInfo fInfo = fInfos[j];
assertNotNull(fInfo);
JDOFieldInfoNature fNature = new JDOFieldInfoNature(fInfo);
assertNotNull(fNature);
String columnName = fNature.getColumnName();
String columnType = fNature.getColumnType();
XMLInfoNature xmlFieldNature = new XMLInfoNature(fInfo);
if (xmlFieldNature.getNodeName().equals("ssn")) {
assertEquals("ssn", columnName);
assertEquals("bigint", columnType);
} else if (xmlFieldNature.getNodeName().equals("firstName")) {
assertEquals("firstName", columnName);
assertEquals("varchar", columnType);
} else if (xmlFieldNature.getNodeName().equals("lastName")) {
assertEquals("lastName", columnName);
assertEquals("varchar", columnType);
} else if (xmlFieldNature.getNodeName().equals("birthdate")) {
assertEquals("birthdate", columnName);
assertEquals("date", columnType);
} else {
fail("Unexpected FieldInfo Element encountered!");
}
}
} else if (xmlNature.getNodeName().equals("insurant")) {
String tableName = cNature.getTableName();
assertEquals("insurant", tableName);
List primaryKeys = cNature.getPrimaryKeys();
assertEquals(2, primaryKeys.size());
assertEquals("ssn", (String) primaryKeys.get(0));
assertEquals("policyNumber", (String) primaryKeys.get(1));
assertEquals(1, cInfo.getFieldCount());
FieldInfo fInfo = cInfo.getElementField("policyNumber");
assertNotNull(fInfo);
JDOFieldInfoNature fNature = new JDOFieldInfoNature(fInfo);