@Test
public void testLoadDbModel() {
final DBDatabase db = parser.loadDbModel();
final DBTable departments = db.getTable("DEPARTMENTS");
final DBTable employees = db.getTable("EMPLOYEES");
assertNotNull("Expected DEPARTMENTS table.", departments);
assertNotNull("Expected EMPLOYEES table.", employees);
final List<DBRelation> relations = db.getRelations();
assertEquals("Should have two relations.", 2, relations.size());
final DBRelation dbRelation = relations.get(1);
assertEquals("EMPLOYEES_DEPARTMENT_I_FK", dbRelation.getName());
final DBReference[] references = dbRelation.getReferences();
assertEquals("Should reference one column.", 1, references.length);
final DBReference dbReference = references[0];
assertEquals(dbReference.getSourceColumn(), employees.getColumn("DEPARTMENT_ID"));
assertEquals(dbReference.getTargetColumn(), departments.getColumn("DEPARTMENT_ID"));
final DBColumn salary = employees.getColumn("SALARY");
assertThat(salary.getDataType(), is(DECIMAL));
assertThat(salary.getSize(), is(121.212));
}