use of org.opentripplanner.model.FareRule in project OpenTripPlanner by opentripplanner.
the class FareRuleMapper method doMap.
private FareRule doMap(org.onebusaway.gtfs.model.FareRule rhs) {
FareRule lhs = new FareRule();
lhs.setFare(fareAttributeMapper.map(rhs.getFare()));
lhs.setRoute(routeMapper.map(rhs.getRoute()));
lhs.setOriginId(rhs.getOriginId());
lhs.setDestinationId(rhs.getDestinationId());
lhs.setContainsId(rhs.getContainsId());
return lhs;
}
use of org.opentripplanner.model.FareRule in project OpenTripPlanner by opentripplanner.
the class OtpTransitServiceImplTest method createFareRule.
private static FareRule createFareRule() {
FareAttribute fa = new FareAttribute();
fa.setId(new FeedScopedId(FEED_ID, "FA"));
FareRule rule = new FareRule();
rule.setOriginId("Zone A");
rule.setContainsId("Zone B");
rule.setDestinationId("Zone C");
rule.setFare(fa);
return rule;
}
use of org.opentripplanner.model.FareRule in project OpenTripPlanner by opentripplanner.
the class OtpTransitServiceImplTest method setup.
@BeforeClass
public static void setup() throws IOException {
GtfsContextBuilder contextBuilder = contextBuilder(FEED_ID, ConstantsForTests.FAKE_GTFS);
OtpTransitServiceBuilder builder = contextBuilder.getTransitBuilder();
agency = first(builder.getAgenciesById().values());
// Supplement test data with at least one entity in all collections
FareRule rule = createFareRule();
builder.getFareAttributes().add(rule.getFare());
builder.getFareRules().add(rule);
builder.getFeedInfos().add(new FeedInfo());
subject = builder.build();
}
use of org.opentripplanner.model.FareRule in project OpenTripPlanner by opentripplanner.
the class CalendarServiceDataFactoryImplTest method createCtxBuilder.
private static GtfsContext createCtxBuilder() throws IOException {
GtfsContextBuilder ctxBuilder = contextBuilder(FEED_ID, ConstantsForTests.FAKE_GTFS);
OtpTransitServiceBuilder builder = ctxBuilder.withDataImportIssueStore(new DataImportIssueStore(false)).getTransitBuilder();
Agency agency = agency(builder);
// Supplement test data with at least one entity in all collections
builder.getCalendarDates().add(removeMondayFromAlldays());
builder.getFareAttributes().add(createFareAttribute(agency));
builder.getFareRules().add(new FareRule());
builder.getFeedInfos().add(new FeedInfo());
return ctxBuilder.build();
}
use of org.opentripplanner.model.FareRule in project OpenTripPlanner by opentripplanner.
the class OtpTransitServiceBuilderTest method createBuilder.
/* private methods */
private static OtpTransitServiceBuilder createBuilder() throws IOException {
OtpTransitServiceBuilder builder = contextBuilder(FEED_ID, ConstantsForTests.FAKE_GTFS).getTransitBuilder();
Agency agency = agency(builder);
// Supplement test data with at least one entity in all collections
builder.getCalendarDates().add(createAServiceCalendarDateExclution(SERVICE_WEEKDAYS_ID));
builder.getFareAttributes().add(createFareAttribute(agency));
builder.getFareRules().add(new FareRule());
builder.getFeedInfos().add(new FeedInfo());
return builder;
}
Aggregations