Ignore:
Timestamp:
2019-05-29T06:28:43+02:00 (5 years ago)
Author:
GerdP
Message:

add test for handling of multipolygon ways

File:
1 edited

Legend:

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

    r15134 r15136  
    1515import org.openstreetmap.josm.data.osm.Node;
    1616import org.openstreetmap.josm.data.osm.OsmUtils;
     17import org.openstreetmap.josm.data.osm.Relation;
     18import org.openstreetmap.josm.data.osm.RelationMember;
    1719import org.openstreetmap.josm.data.osm.Way;
    1820import org.openstreetmap.josm.gui.mappaint.ElemStyles;
     
    7678    }
    7779
     80    /**
     81     * Test to make sure the multipolygon ways are ignored
     82     * @throws Exception if an exception occurs
     83     */
     84    @Test
     85    public void testWayInMultiPolygon() throws Exception {
     86        UnclosedWays uwTest = new UnclosedWays();
     87        uwTest.initialize();
     88        uwTest.startTest(null);
     89        DataSet ds = new DataSet();
     90
     91        // Erroneous tag
     92        Way w = createUnclosedWay("natural=water", ds);
     93        Relation r = (Relation) OsmUtils.createPrimitive("relation type=multipolygon natural=wood");
     94        r.addMember(new RelationMember("inner", w));
     95        ds.addPrimitive(r);
     96        uwTest.visit(w);
     97        assertTrue(ElemStyles.hasAreaElemStyle(w, false));
     98        assertEquals(0, uwTest.getErrors().size());
     99
     100        uwTest.endTest();
     101    }
     102
    78103 }
Note: See TracChangeset for help on using the changeset viewer.