assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, "AGE", Types.NUMERIC, SQLTypeMapping.UNKNOWN_LENGTH, 3, SQLTypeMapping.UNKNOWN_SCALE, true, false) );
}
public void testSchemaSelection() {
OverrideRepository or = buildOverrideRepository();
or.addResource(SCHEMA_REVENG_XML);
ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
List schemaSelectors = repository.getSchemaSelections();
assertNotNull(schemaSelectors);
assertEquals(4,schemaSelectors.size());
SchemaSelection ss;
ss = (SchemaSelection) schemaSelectors.get(0);
assertEquals(null,ss.getMatchCatalog());
assertEquals(null,ss.getMatchSchema());
assertEquals(null,ss.getMatchTable());
ss = (SchemaSelection) schemaSelectors.get(1);
assertEquals(null,ss.getMatchCatalog());
assertEquals("OVRTEST",ss.getMatchSchema());
assertEquals(null,ss.getMatchTable());
ss = (SchemaSelection) schemaSelectors.get(2);
assertEquals("UBERCATALOG",ss.getMatchCatalog());
assertEquals("OVRTEST",ss.getMatchSchema());
assertEquals(null,ss.getMatchTable());
ss = (SchemaSelection) schemaSelectors.get(3);
assertEquals("PUBLIC.*",ss.getMatchCatalog());
assertEquals("OVRTEST",ss.getMatchSchema());
assertEquals(".*",ss.getMatchTable());
JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
OverrideRepository ox = new OverrideRepository();
ox.addSchemaSelection(new SchemaSelection(null, null, "DUMMY.*"));
configuration.setReverseEngineeringStrategy(ox.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
configuration.readFromJDBC();
Iterator tableMappings = configuration.getTableMappings();
Table t = (Table) tableMappings.next();
assertEquals(t.getName(), "DUMMY");