Changeset 10141 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-04-11T22:06:50+02:00 (5 years ago)
Author:
simon04
Message:

Validate that stop position lies on public transport route

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTestTest.java

    r9933 r10141  
    6767        assertEquals("Route relation contains a gap", test.getErrors().get(0).getMessage());
    6868
     69        final Relation r5 = TestUtils.newRelation("type=route route=tram public_transport:version=2",
     70                new RelationMember("", w1), new RelationMember("", w2), new RelationMember("", w3),
     71                new RelationMember("stop", w1.firstNode()), new RelationMember("stop", w4.lastNode()));
     72        test.startTest(null);
     73        test.visit(r5);
     74        assertEquals(1, test.getErrors().size());
     75        assertEquals("Stop position not part of route", test.getErrors().get(0).getMessage());
     76        assertEquals(w4.lastNode(), test.getErrors().get(0).getPrimitives().iterator().next());
     77
    6978    }
    7079}
Note: See TracChangeset for help on using the changeset viewer.