use of org.onebusaway.csv_entities.schema.EntitySchema in project onebusaway-gtfs-modules by OneBusAway.
the class EntitySchemaCacheTest method test.
@Test
public void test() {
EntitySchemaCache cache = new EntitySchemaCache();
EntitySchema schema = new EntitySchema(Route.class, "routes.txt", true);
FieldMapping fieldMapping = new DefaultFieldMapping(Route.class, "route_short_name", "shortName", String.class, false);
schema.addField(fieldMapping);
cache.addEntitySchema(schema);
assertSame(cache.getSchemaForFileName("routes.txt"), schema);
assertSame(cache.getSchemaForEntityType(Route.class), schema);
assertSame(cache.getFieldMappingForCsvFieldName(Route.class, "route_short_name"), fieldMapping);
assertSame(cache.getFieldMappingForObjectFieldName(Route.class, "shortName"), fieldMapping);
}
Aggregations