Skip to content

Commit

Permalink
Prep for first release - base validation
Browse files Browse the repository at this point in the history
-exclude files that were newly defined in schema and crashed on a nullpointerException
-exclude file that contain date fields as we don't support them yet
  • Loading branch information
Fabrice V committed Mar 11, 2020
1 parent 22ff295 commit f8e9e08
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,23 @@ public static void main(String[] args) {
config.unzipInputArchive(zipInputPath, config.cleanOrCreatePath(zipExtractTargetPath).execute()).execute();
config.validateAllRequiredFilePresence().execute();

//TODO: we will loop through all files in the archive. MVP is for stops.txt
config.validateHeadersForFile("stops.txt").execute();
config.validateAllRowLengthForFile("stops.txt").execute();
List<String> filenameList = List.of("feed_info.txt", "agency.txt", "stops.txt", "routes.txt",
/*"calendar.txt", "calendar_dates.txt",*/ "trips.txt", //"stop_times.txt", //"fare_attributes.txt",
/*"fare_rules.txt", "frequencies.txt", "translations.txt", "transfers.txt",*/ "pathways.txt",
"levels.txt"/*, "attributions.txt"*/);

ParseSingleRowForFile parseSingleRowForFile = config.parseSingleRowForFile("stops.txt");
while (parseSingleRowForFile.hasNext()) {
config.validateGtfsTypes().execute(parseSingleRowForFile.execute());
}
// base validation
filenameList.forEach(filename -> {
logger.info("Validating: " + filename);

config.validateHeadersForFile(filename).execute();
config.validateAllRowLengthForFile(filename).execute();

ParseSingleRowForFile parseSingleRowForFile = config.parseSingleRowForFile(filename);
while (parseSingleRowForFile.hasNext()) {
config.validateGtfsTypes().execute(parseSingleRowForFile.execute());
}
});

logger.info("validation repo content:" + config.getValidationResult());

Expand Down

0 comments on commit f8e9e08

Please sign in to comment.