Skip to content

Commit

Permalink
move Herrenberg data into the test method
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Dec 19, 2024
1 parent d40d0b3 commit 271f305
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ class OsmBoardingLocationsModuleTest {

private final TimetableRepositoryForTest testModel = TimetableRepositoryForTest.of();

File file = ResourceLoader
.of(OsmBoardingLocationsModuleTest.class)
.file("herrenberg-minimal.osm.pbf");
RegularStop platform = testModel
.stop("de:08115:4512:4:101")
.withCoordinate(48.59328, 8.86128)
.build();
RegularStop busStop = testModel.stop("de:08115:4512:5:C", 48.59434, 8.86452).build();
RegularStop floatingBusStop = testModel.stop("floating-bus-stop", 48.59417, 8.86464).build();

static Stream<Arguments> testCases() {
return Stream.of(
Arguments.of(
Expand All @@ -70,6 +60,16 @@ static Stream<Arguments> testCases() {
)
@MethodSource("testCases")
void addAndLinkBoardingLocations(boolean areaVisibility, Set<String> linkedVertices) {
File file = ResourceLoader
.of(OsmBoardingLocationsModuleTest.class)
.file("herrenberg-minimal.osm.pbf");
RegularStop platform = testModel
.stop("de:08115:4512:4:101")
.withCoordinate(48.59328, 8.86128)
.build();
RegularStop busStop = testModel.stop("de:08115:4512:5:C", 48.59434, 8.86452).build();
RegularStop floatingBusStop = testModel.stop("floating-bus-stop", 48.59417, 8.86464).build();

var deduplicator = new Deduplicator();
var graph = new Graph(deduplicator);
var timetableRepository = new TimetableRepository(new SiteRepository(), deduplicator);
Expand Down Expand Up @@ -146,13 +146,13 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set<String> linkedVerti

assertEquals(1, platformCentroids.size());

var platform = platformCentroids.get(0);
var platformCentroid = platformCentroids.get(0);

assertConnections(platform, Set.of(BoardingLocationToStopLink.class, AreaEdge.class));
assertConnections(platformCentroid, Set.of(BoardingLocationToStopLink.class, AreaEdge.class));

assertEquals(
linkedVertices,
platform
platformCentroid
.getOutgoingStreetEdges()
.stream()
.map(Edge::getToVertex)
Expand All @@ -162,7 +162,7 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set<String> linkedVerti

assertEquals(
linkedVertices,
platform
platformCentroid
.getIncomingStreetEdges()
.stream()
.map(Edge::getFromVertex)
Expand Down

0 comments on commit 271f305

Please sign in to comment.