public void testDescription() { Fixture f = new Fixture(); assertNull(f.tRoute.getDescription()); String desc = "some random description string."; f.tRoute.setDescription(desc); assertEquals(desc, f.tRoute.getDescription()); desc += " [updated]"; f.tRoute.setDescription(desc); assertEquals(desc, f.tRoute.getDescription()); }
private void writeTransitRoute(final TransitRoute route) throws UncheckedIOException { List<Tuple<String, String>> attributes = new ArrayList<Tuple<String, String>>(1); attributes.add(this.createTuple(Constants.ID, route.getId().toString())); this.writeStartTag(Constants.TRANSIT_ROUTE, attributes); if (route.getDescription() != null) { this.writeStartTag(Constants.DESCRIPTION, null); this.writeContent(route.getDescription(), false); this.writeEndTag(Constants.DESCRIPTION); } this.writeStartTag(Constants.TRANSPORT_MODE, null); this.writeContent(route.getTransportMode(), false); this.writeEndTag(Constants.TRANSPORT_MODE); this.writeRouteProfile(route.getStops()); this.writeRoute(route.getRoute()); this.writeDepartures(route.getDepartures()); this.writeEndTag(Constants.TRANSIT_ROUTE); }
private void writeTransitRoute(final TransitRoute route) throws IOException, UncheckedIOException { List<Tuple<String, String>> attributes = new ArrayList<>(1); attributes.add(createTuple(Constants.ID, route.getId().toString())); this.writeStartTag(Constants.TRANSIT_ROUTE, attributes); if (!AttributesUtils.isEmpty(route.getAttributes())) { this.writer.write(NL); this.attributesWriter.writeAttributes("\t\t\t", this.writer, route.getAttributes()); } if (route.getDescription() != null) { this.writeStartTag(Constants.DESCRIPTION, null); this.writeContent(route.getDescription(), false); this.writeEndTag(Constants.DESCRIPTION); } this.writeStartTag(Constants.TRANSPORT_MODE, null); this.writeContent(route.getTransportMode(), false); this.writeEndTag(Constants.TRANSPORT_MODE); this.writeRouteProfile(route.getStops()); this.writeRoute(route.getRoute()); this.writeDepartures(route.getDepartures()); this.writeEndTag(Constants.TRANSIT_ROUTE); }
TransitRoute route1 = line.getRoutes().get(routeId1); assertNotNull(route1); assertEquals(description, route1.getDescription());
assertNotNull(route1); assertEquals(routeId1, route1.getId()); assertNull(route1.getDescription()); assertEquals("bus", route1.getTransportMode()); assertEquals(0, route1.getStops().size());
TransitRoute routeA = lineA.getRoutes().get(routeE.getId()); assertNotNull("transit route not found: " + routeE.getId().toString(), routeA); assertEquals("different route descriptions.", routeE.getDescription(), routeA.getDescription());