use of org.rutebanken.netex.model.MultilingualString in project OpenTripPlanner by opentripplanner.
the class OperatorToAgencyMapperTest method mapOperatorWithMinimumDataSet.
@Test
public void mapOperatorWithMinimumDataSet() {
// Given
Operator operator = new Operator().withId(ID).withName(new MultilingualString().withValue(NAME));
// When mapped
org.opentripplanner.model.Operator o;
o = new OperatorToAgencyMapper(MappingSupport.ID_FACTORY).mapOperator(operator);
// Then expect
assertEquals(ID, o.getId().getId());
assertEquals(NAME, o.getName());
assertNull(o.getUrl());
assertNull(o.getPhone());
}
use of org.rutebanken.netex.model.MultilingualString in project OpenTripPlanner by opentripplanner.
the class RouteMapperTest method createExampleLine.
private Line createExampleLine() {
Line line = new Line();
line.setId(RUT_LINE_ID);
line.setTransportMode(AllVehicleModesOfTransportEnumeration.METRO);
line.setName(new MultilingualString().withValue("Line 1"));
line.setPublicCode("L1");
line.setRepresentedByGroupRef(new GroupOfLinesRefStructure().withRef(NETWORK_ID));
return line;
}
use of org.rutebanken.netex.model.MultilingualString in project OpenTripPlanner by opentripplanner.
the class NoticeMapperTest method mapNotice.
@Test
public void mapNotice() {
org.opentripplanner.model.Notice otpNotice;
// Given
NoticeMapper mapper = new NoticeMapper(MappingSupport.ID_FACTORY);
// And
Notice netexNotice = new Notice();
netexNotice.setId(NOTICE_ID);
netexNotice.setText(new MultilingualString().withValue(NOTICE_TEXT));
netexNotice.setPublicCode(PUBLIC_CODE);
// When
otpNotice = mapper.map(netexNotice);
// Then
assertEquals(NOTICE_ID, otpNotice.getId().getId());
assertEquals(NOTICE_TEXT, otpNotice.getText());
assertEquals(PUBLIC_CODE, otpNotice.getPublicCode());
// And when other instance with same id is mapped, the first one is returned
// from cache - ignoring all properties except the id
otpNotice = mapper.map(new Notice().withId(NOTICE_ID).withPublicCode("Albatross").withText(new MultilingualString().withValue("Different text")));
// Then
assertEquals(NOTICE_ID, otpNotice.getId().getId());
assertEquals("Not Albatross", NOTICE_TEXT, otpNotice.getText());
}
use of org.rutebanken.netex.model.MultilingualString in project OpenTripPlanner by opentripplanner.
the class OperatorToAgencyMapperTest method mapOperatorWithEverything.
@Test
public void mapOperatorWithEverything() {
// Given
Operator operator = new Operator().withId(ID).withName(new MultilingualString().withValue(NAME)).withContactDetails(new ContactStructure().withUrl(URL).withPhone(PHONE));
// When mapped
org.opentripplanner.model.Operator o;
o = new OperatorToAgencyMapper(MappingSupport.ID_FACTORY).mapOperator(operator);
// Then expect
assertEquals(ID, o.getId().getId());
assertEquals(NAME, o.getName());
assertEquals(URL, o.getUrl());
assertEquals(PHONE, o.getPhone());
}
Aggregations