Changeset 12312 in josm for trunk/test/unit
- Timestamp:
- 2017-06-04T18:39:14+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/HighwaysTest.java
r11403 r12312 5 5 import static org.junit.Assert.assertFalse; 6 6 import static org.junit.Assert.assertTrue; 7 import static org.junit.Assert.fail; 8 9 import java.io.InputStream; 10 import java.util.Collection; 7 11 8 12 import org.junit.Before; 9 13 import org.junit.Test; 10 14 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm.TestUtils; 11 16 import org.openstreetmap.josm.data.coor.LatLon; 12 17 import org.openstreetmap.josm.data.osm.DataSet; … … 14 19 import org.openstreetmap.josm.data.osm.Way; 15 20 import org.openstreetmap.josm.data.validation.TestError; 21 import org.openstreetmap.josm.io.OsmReader; 16 22 17 23 /** … … 96 102 assertEquals("GB:nsl_single", link.get("source:maxspeed")); 97 103 } 104 105 /** 106 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/14891">Bug #14891</a>. 107 * @throws Exception if an error occurs 108 */ 109 @Test 110 public void testTicket14891() throws Exception { 111 try (InputStream is = TestUtils.getRegressionDataStream(14891, "14891.osm.bz2")) { 112 Collection<Way> ways = OsmReader.parseDataSet(is, null).getWays(); 113 Way roundabout = ways.stream().filter(w -> 10068083 == w.getId()).findFirst().get(); 114 Highways test = new Highways(); 115 test.visit(roundabout); 116 if (!test.getErrors().isEmpty()) { 117 fail(test.getErrors().get(0).getMessage()); 118 } 119 Way w1 = ways.stream().filter(w -> 28508494 == w.getId()).findFirst().get(); 120 Way w2 = ways.stream().filter(w -> 28508493 == w.getId()).findFirst().get(); 121 test.visit(w1); 122 test.visit(w2); 123 assertEquals(2, test.getErrors().size()); 124 } 125 } 98 126 }
Note:
See TracChangeset
for help on using the changeset viewer.