public class NaPTANStopTest {
@Test
public void test() throws IOException {
CsvEntityReader reader = new CsvEntityReader();
reader.setInputLocation(new File(
"src/test/resources/org/onebusaway/uk/naptan/csv/test_data"));
AnnotationDrivenEntitySchemaFactory entitySchema = new AnnotationDrivenEntitySchemaFactory();
entitySchema.addPackageToScan("org.onebusaway.uk.naptan.csv");
reader.setEntitySchemaFactory(entitySchema);
ListEntityHandler<NaPTANStop> stopHandler = new ListEntityHandler<NaPTANStop>();
reader.addEntityHandler(stopHandler);
reader.readEntities(NaPTANStop.class);
reader.close();
List<NaPTANStop> stops = stopHandler.getValues();
assertEquals(2, stops.size());
NaPTANStop stop = stops.get(0);
assertEquals("010000001", stop.getAtcoCode());
assertEquals("bstpgit", stop.getNaptanCode());