- Timestamp:
- 2019-05-28T22:03:17+02:00 (5 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/validation/tests
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
r14138 r15134 2 2 package org.openstreetmap.josm.data.validation.tests; 3 3 4 import static org.junit.Assert.assertEquals;5 import static org.junit.Assert.assertFalse;6 import static org.junit.Assert.assertTrue;7 8 import java.util.ArrayList;9 import java.util.List;10 4 import java.util.stream.Collectors; 11 5 12 6 import org.junit.Rule; 13 7 import org.junit.Test; 14 import org.openstreetmap.josm.data.coor.LatLon;15 import org.openstreetmap.josm.data.osm.Node;16 import org.openstreetmap.josm.data.osm.OsmUtils;17 8 import org.openstreetmap.josm.data.osm.Relation; 18 import org.openstreetmap.josm.data.osm.Way;19 import org.openstreetmap.josm.gui.mappaint.ElemStyles;20 9 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 10 … … 37 26 public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main(); 38 27 39 private static Way createUnclosedWay(String tags) {40 List<Node> nodes = new ArrayList<>();41 nodes.add(new Node(new LatLon(0, 1)));42 nodes.add(new Node(new LatLon(0, 2)));43 44 Way w = (Way) OsmUtils.createPrimitive("way "+tags);45 w.setNodes(nodes);46 return w;47 }48 49 /**50 * Non-regression test for bug #10469.51 * @throws Exception if an exception occurs52 */53 @Test54 public void testTicket10469() throws Exception {55 MULTIPOLYGON_TEST.initialize();56 MULTIPOLYGON_TEST.startTest(null);57 58 // Erroneous tag59 Way w = createUnclosedWay("amenity=parking");60 MULTIPOLYGON_TEST.visit(w);61 assertTrue(ElemStyles.hasAreaElemStyle(w, false));62 assertEquals(1, MULTIPOLYGON_TEST.getErrors().size());63 64 // Erroneous tag, but managed by another test65 w = createUnclosedWay("building=yes");66 MULTIPOLYGON_TEST.visit(w);67 assertTrue(ElemStyles.hasAreaElemStyle(w, false));68 assertEquals(1, MULTIPOLYGON_TEST.getErrors().size());69 70 // Correct tag, without area style since #10601 (r7603)71 w = createUnclosedWay("aeroway=taxiway");72 MULTIPOLYGON_TEST.visit(w);73 assertFalse(ElemStyles.hasAreaElemStyle(w, false));74 assertEquals(1, MULTIPOLYGON_TEST.getErrors().size());75 76 MULTIPOLYGON_TEST.endTest();77 }78 79 28 /** 80 29 * Test all error cases manually created in multipolygon.osm.
Note:
See TracChangeset
for help on using the changeset viewer.