Skip to content

Commit b9049f6

Browse files
authored
Merge f998067 into 754379e
2 parents 754379e + f998067 commit b9049f6

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

main/src/main/java/org/mobilitydata/gtfsvalidator/report/model/FeedMetadata.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ private <E extends GtfsEntity> int loadUniqueCount(
8787
private void loadSpecFeatures(GtfsFeedContainer feedContainer) {
8888
specFeatures.put(
8989
"Pathways", hasOneRecordOfComponent(feedContainer, GtfsPathway.FILENAME) ? "Yes" : "No");
90+
specFeatures.put(
91+
"Transfers", hasOneRecordOfComponent(feedContainer, GtfsTransfer.FILENAME) ? "Yes" : "No");
9092
var fareAttributesTable = feedContainer.getTableForFilename(GtfsFareAttribute.FILENAME);
9193
boolean faresV1 =
9294
fareAttributesTable.isPresent() && fareAttributesTable.get().entityCount() > 0;

main/src/test/java/org/mobilitydata/gtfsvalidator/report/model/FeedMetadataTest.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,19 @@ public void omitsComponents() throws IOException, InterruptedException {
251251
validateSpecFeature(
252252
"Route Names",
253253
"No",
254-
ImmutableList.of(GtfsPathwayTableDescriptor.class, GtfsAgencyTableDescriptor.class));
254+
ImmutableList.of(GtfsRouteTableDescriptor.class, GtfsAgencyTableDescriptor.class));
255255
validateSpecFeature(
256256
"Shapes",
257257
"No",
258-
ImmutableList.of(GtfsPathwayTableDescriptor.class, GtfsAgencyTableDescriptor.class));
258+
ImmutableList.of(GtfsShapeTableDescriptor.class, GtfsAgencyTableDescriptor.class));
259+
validateSpecFeature(
260+
"Route Colors",
261+
"No",
262+
ImmutableList.of(GtfsRouteTableDescriptor.class, GtfsAgencyTableDescriptor.class));
263+
validateSpecFeature(
264+
"Transfers",
265+
"No",
266+
ImmutableList.of(GtfsTransferTableDescriptor.class, GtfsAgencyTableDescriptor.class));
259267
}
260268

261269
@Test
@@ -268,4 +276,15 @@ public void containsShapesComponentTest() throws IOException, InterruptedExcepti
268276
"Yes",
269277
ImmutableList.of(GtfsShapeTableDescriptor.class, GtfsAgencyTableDescriptor.class));
270278
}
279+
280+
@Test
281+
public void containsTransfersComponentTest() throws IOException, InterruptedException {
282+
String transfersContent =
283+
"from_stop_id,to_stop_id,transfer_type,min_transfer_time\n" + "COMMDEV1,COMMDEV4,,\n";
284+
createDataFile("transfers.txt", transfersContent);
285+
validateSpecFeature(
286+
"Transfers",
287+
"Yes",
288+
ImmutableList.of(GtfsTransferTableDescriptor.class, GtfsAgencyTableDescriptor.class));
289+
}
271290
}

0 commit comments

Comments
 (0)