Changeset 35288 in osm for applications/editors/josm/plugins/comfort0/test/unit
- Timestamp:
- 2020-01-13T21:45:26+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/comfort0/test/unit/net/simon04/comfort0/level0l/parsergen/Level0LParserTest.java
r35285 r35288 8 8 import org.junit.Test; 9 9 import org.openstreetmap.josm.data.osm.NodeData; 10 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 11 import org.openstreetmap.josm.data.osm.RelationData; 10 12 import org.openstreetmap.josm.data.osm.WayData; 11 13 … … 45 47 assertThat(way.getKeys().get("name"), is("Pastower Straße")); 46 48 } 49 50 @Test 51 public void testRelation() throws Exception { 52 final String level0l = "" + 53 "relation 56688 # member types: nd, wy, rel; roles are put after ids\n" + 54 " nd 294942404\n" + 55 " nd 364933006 # the second node\n" + 56 " wy 4579143 forward\n" + 57 " nd 249673494 stop # the end\n" + 58 " name = Küstenbus Linie 123\n" + 59 " network = VVW\n" + 60 " operator = Regionalverkehr Küste\n" + 61 " ref = 123\n" + 62 " route = bus\n" + 63 " type = route\n"; 64 final RelationData relation = new Level0LParser(new StringReader(level0l)).relation(); 65 assertThat(relation.getId(), is(56688L)); 66 assertThat(relation.getMembersCount(), is(4)); 67 assertThat(relation.getMembers().get(0).getMemberId(), is(294942404L)); 68 assertThat(relation.getMembers().get(0).getMemberType(), is(OsmPrimitiveType.NODE)); 69 assertThat(relation.getMembers().get(0).getRole(), is("")); 70 assertThat(relation.getMembers().get(2).getMemberId(), is(4579143L)); 71 assertThat(relation.getMembers().get(2).getMemberType(), is(OsmPrimitiveType.WAY)); 72 assertThat(relation.getMembers().get(2).getRole(), is("forward")); 73 assertThat(relation.getKeys().size(), is(6)); 74 } 47 75 }
Note:
See TracChangeset
for help on using the changeset viewer.