Skip to content

Commit b0621bd

Browse files
committed
Merge remote-tracking branch 'otp/dev-2.x' into add_co2_emmistions
2 parents d2ef16e + 1732221 commit b0621bd

File tree

138 files changed

+2371
-1189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2371
-1189
lines changed

.github/workflows/prune-container-images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
CONTAINER_REGISTRY_USER: otpbot
1717
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
1818
run: |
19-
# remove all snapshot container images that have not been pulled for over a year
19+
# remove all snapshot container images that have not been pulled for a long time
2020
# --keep-semver makes sure that any image with a x.y.z version scheme is unaffected by this
2121
pip install prune-container-repo==0.0.4
22-
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=365 --keep-semver --activate
22+
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=180 --keep-semver --activate

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ GTFS and OpenStreetMap). It applies real-time updates and alerts with immediate
1616
clients, finding itineraries that account for disruptions and service changes.
1717

1818
Note that this branch contains **OpenTripPlanner 2**, the second major version of OTP, which has
19-
been under development since 2018. The latest version of OTP is v2.5.0, released in March 2024.
20-
21-
If you do not want to use this version, please switch to the final 1.x release
22-
tag `v1.5.0` or the `dev-1.x` branch.
19+
been under development since 2018 and is now the dominant one and the only one being supported.
2320

2421
## Performance Test
2522

application/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<dependency>
173173
<groupId>org.mockito</groupId>
174174
<artifactId>mockito-core</artifactId>
175-
<version>5.15.2</version>
175+
<version>5.16.1</version>
176176
<scope>test</scope>
177177
</dependency>
178178
<dependency>
@@ -289,7 +289,7 @@
289289
<dependency>
290290
<groupId>org.onebusaway</groupId>
291291
<artifactId>onebusaway-gtfs</artifactId>
292-
<version>6.1.0</version>
292+
<version>6.1.2</version>
293293
</dependency>
294294
<!-- Processing is used for the debug GUI (though we could probably use just Java2D) -->
295295
<dependency>
@@ -359,17 +359,17 @@
359359
<dependency>
360360
<groupId>com.azure</groupId>
361361
<artifactId>azure-core</artifactId>
362-
<version>1.55.2</version>
362+
<version>1.55.3</version>
363363
</dependency>
364364
<dependency>
365365
<groupId>com.azure</groupId>
366366
<artifactId>azure-messaging-servicebus</artifactId>
367-
<version>7.17.8</version>
367+
<version>7.17.10</version>
368368
</dependency>
369369
<dependency>
370370
<groupId>com.azure</groupId>
371371
<artifactId>azure-identity</artifactId>
372-
<version>1.15.3</version>
372+
<version>1.15.4</version>
373373
<scope>compile</scope>
374374
</dependency>
375375
<dependency>

application/src/client/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<link rel="icon" type="image/svg+xml" href="/img/otp-logo.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>OTP Debug</title>
8-
<script type="module" crossorigin src="https://www.opentripplanner.org/debug-client-assets/2025/03/2025-03-14T08:17/assets/index-B-YTxQ1V.js"></script>
9-
<link rel="stylesheet" crossorigin href="https://www.opentripplanner.org/debug-client-assets/2025/03/2025-03-14T08:17/assets/index-CiWBeHPw.css">
8+
<script type="module" crossorigin src="https://www.opentripplanner.org/debug-client-assets/2025/03/2025-03-26T08:20/assets/index-D1F3OmAI.js"></script>
9+
<link rel="stylesheet" crossorigin href="https://www.opentripplanner.org/debug-client-assets/2025/03/2025-03-26T08:20/assets/index-CiWBeHPw.css">
1010
</head>
1111
<body>
1212
<div id="root"></div>

application/src/ext-test/java/org/opentripplanner/ext/accessibilityscore/DecorateWithAccessibilityScoreTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,16 @@ void noScoreForNonWalking(Function<TestItineraryBuilder, TestItineraryBuilder> m
7777
assertNull(itinerary.accessibilityScore());
7878
itinerary.legs().forEach(l -> assertNull(l.accessibilityScore()));
7979
}
80+
81+
/**
82+
* Only itinerary which are walk-only or have a transit leg should have an itinerary-level
83+
* score.
84+
*/
85+
@MethodSource("nonWalkingCases")
86+
@ParameterizedTest
87+
void itineraryLevelScore(Function<TestItineraryBuilder, TestItineraryBuilder> modifier) {
88+
var itinerary = modifier.apply(newItinerary(A, 0)).walk(10, C).build();
89+
itinerary = DECORATOR.decorate(itinerary);
90+
assertNull(itinerary.accessibilityScore());
91+
}
8092
}

application/src/ext-test/java/org/opentripplanner/ext/fares/FaresFilterTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.junit.jupiter.api.Test;
99
import org.opentripplanner.model.fare.FareProduct;
1010
import org.opentripplanner.model.fare.FareProductUse;
11-
import org.opentripplanner.model.fare.ItineraryFares;
11+
import org.opentripplanner.model.fare.ItineraryFare;
1212
import org.opentripplanner.model.plan.Itinerary;
1313
import org.opentripplanner.model.plan.Place;
1414
import org.opentripplanner.model.plan.PlanTestConstants;
@@ -30,9 +30,9 @@ void shouldAddFare() {
3030
.bus(ID, 52, 100, C)
3131
.build();
3232

33-
assertEquals(ItineraryFares.empty(), i1.fare());
33+
assertEquals(ItineraryFare.empty(), i1.fare());
3434

35-
var fares = new ItineraryFares();
35+
var fares = new ItineraryFare();
3636

3737
var leg = i1.legs().get(1);
3838
var fp = new FareProduct(id("fp"), "fare product", Money.euros(10.00f), null, null, null);

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/DefaultFareServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.junit.jupiter.api.Test;
2121
import org.opentripplanner.model.fare.FareProduct;
2222
import org.opentripplanner.model.fare.FareProductUse;
23-
import org.opentripplanner.model.fare.ItineraryFares;
23+
import org.opentripplanner.model.fare.ItineraryFare;
2424
import org.opentripplanner.model.plan.Place;
2525
import org.opentripplanner.model.plan.PlanTestConstants;
2626
import org.opentripplanner.routing.core.FareType;
@@ -47,7 +47,7 @@ void noRules() {
4747
service.addFareRules(FareType.regular, List.of());
4848
var itin = newItinerary(A, T11_00).bus(1, T11_05, T11_12, B).build();
4949
var fare = service.calculateFares(itin);
50-
assertEquals(ItineraryFares.empty(), fare);
50+
assertEquals(ItineraryFare.empty(), fare);
5151
}
5252

5353
@Test

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/FaresIntegrationTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.opentripplanner.TestServerContext;
1515
import org.opentripplanner._support.time.ZoneIds;
1616
import org.opentripplanner.model.GenericLocation;
17-
import org.opentripplanner.model.fare.ItineraryFares;
17+
import org.opentripplanner.model.fare.ItineraryFare;
1818
import org.opentripplanner.model.plan.Itinerary;
1919
import org.opentripplanner.routing.api.request.RouteRequest;
2020
import org.opentripplanner.routing.api.request.preference.ItineraryFilterDebugProfile;
@@ -42,7 +42,7 @@ public void testBasic() {
4242
var from = GenericLocation.fromStopId("Origin", feedId, "Millbrae Caltrain");
4343
var to = GenericLocation.fromStopId("Destination", feedId, "Mountain View Caltrain");
4444

45-
ItineraryFares fare = getFare(from, to, start, serverContext);
45+
ItineraryFare fare = getFare(from, to, start, serverContext);
4646
var product = fare.getLegProducts().values().iterator().next().product();
4747
assertEquals(Money.usDollars(4.25f), product.price());
4848
assertEquals("OW_2", product.id().getId().toString());
@@ -73,7 +73,7 @@ public void testPortland() {
7373
.atZone(ZoneId.of("America/Los_Angeles"))
7474
.toInstant();
7575

76-
ItineraryFares fare = getFare(from, to, startTime, serverContext);
76+
ItineraryFare fare = getFare(from, to, startTime, serverContext);
7777
var fpu = List.copyOf(fare.getLegProducts().values());
7878
assertEquals(1, fpu.size());
7979

@@ -108,7 +108,7 @@ public void testPortland() {
108108
// assertEquals(cost.getFare(FareType.regular), new Money(new WrappedCurrency("USD"), 430));
109109
}
110110

111-
private static ItineraryFares getFare(
111+
private static ItineraryFare getFare(
112112
GenericLocation from,
113113
GenericLocation to,
114114
Instant time,

application/src/ext-test/java/org/opentripplanner/ext/fares/impl/OrcaFareServiceTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.opentripplanner.framework.i18n.NonLocalizedString;
3939
import org.opentripplanner.framework.model.Cost;
4040
import org.opentripplanner.model.fare.FareProductUse;
41-
import org.opentripplanner.model.fare.ItineraryFares;
41+
import org.opentripplanner.model.fare.ItineraryFare;
4242
import org.opentripplanner.model.plan.Itinerary;
4343
import org.opentripplanner.model.plan.Leg;
4444
import org.opentripplanner.model.plan.Place;
@@ -93,12 +93,7 @@ private static void calculateFare(List<Leg> legs, FareType fareType, Money expec
9393
);
9494
}
9595

96-
private static void assertLegFareEquals(
97-
int fare,
98-
Leg leg,
99-
ItineraryFares fares,
100-
boolean hasXfer
101-
) {
96+
private static void assertLegFareEquals(int fare, Leg leg, ItineraryFare fares, boolean hasXfer) {
10297
var legFareProducts = fares.getLegProducts().get(leg);
10398

10499
var rideCost = legFareProducts

application/src/ext-test/java/org/opentripplanner/ext/realtimeresolver/RealtimeResolverTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.opentripplanner.ext.realtimeresolver;
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertFalse;
45
import static org.junit.jupiter.api.Assertions.assertNotNull;
56
import static org.junit.jupiter.api.Assertions.assertTrue;
67
import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary;
@@ -63,13 +64,14 @@ void testPopulateLegsWithRealtime() {
6364
.build();
6465
transitService.getTransitAlertService().setAlerts(List.of(alert));
6566

66-
var itineraries = List.of(itinerary);
67-
itineraries = RealtimeResolver.populateLegsWithRealtime(itineraries, transitService);
67+
var itinerariesWithRealtime = RealtimeResolver.populateLegsWithRealtime(
68+
List.of(itinerary),
69+
transitService
70+
);
6871

69-
assertEquals(1, itineraries.size());
70-
itinerary = itineraries.getFirst();
72+
assertFalse(itinerariesWithRealtime.isEmpty());
7173

72-
var legs = itinerary.legs();
74+
var legs = itinerariesWithRealtime.getFirst().legs();
7375
var leg1ArrivalDelay = legs
7476
.get(0)
7577
.asScheduledTransitLeg()
@@ -81,6 +83,7 @@ void testPopulateLegsWithRealtime() {
8183
assertEquals(123, leg1ArrivalDelay);
8284
assertEquals(0, legs.get(0).getTransitAlerts().size());
8385
assertEquals(1, legs.get(1).getTransitAlerts().size());
86+
assertEquals(1, itinerariesWithRealtime.size());
8487
}
8588

8689
@Test

0 commit comments

Comments
 (0)