Ignore:
Timestamp:
2020-01-13T21:45:18+01:00 (6 years ago)
Author:
simon04
Message:

JOSM/comfort0: parse ways

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/comfort0/test/unit/net/simon04/comfort0/level0l/parsergen/Level0LParserTest.java

    r35284 r35285  
    88import org.junit.Test;
    99import org.openstreetmap.josm.data.osm.NodeData;
     10import org.openstreetmap.josm.data.osm.WayData;
    1011
    1112public class Level0LParserTest {
     
    2425        assertThat(node.getKeys().get("traffic_sign"), is("city_limit"));
    2526    }
     27
     28    @Test
     29    public void testWay() throws Exception {
     30        final String level0l = "" +
     31                "way 26659127\n" +
     32                "  nd 292403538\n" +
     33                "  nd 298884289\n" +
     34                "  nd 261728686\n" +
     35                "  highway = unclassified\n" +
     36                "  name = Pastower Straße\n";
     37        final WayData way = new Level0LParser(new StringReader(level0l)).way();
     38        assertThat(way.getId(), is(26659127L));
     39        assertThat(way.getNodesCount(), is(3));
     40        assertThat(way.getNodeId(0), is(292403538L));
     41        assertThat(way.getNodeId(1), is(298884289L));
     42        assertThat(way.getNodeId(2), is(261728686L));
     43        assertThat(way.getKeys().size(), is(2));
     44        assertThat(way.getKeys().get("highway"), is("unclassified"));
     45        assertThat(way.getKeys().get("name"), is("Pastower Straße"));
     46    }
    2647}
Note: See TracChangeset for help on using the changeset viewer.