Ignore:
Timestamp:
2020-03-06T10:37:17+01:00 (5 years ago)
Author:
GerdP
Message:

fix #18744: "Join Overlapping Areas" shows confusing dialogs when merging inner and outer ways of a multipolygon
Refuse to join ways when one is an outer way and at least one is an inner way of the same multipolygon relation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java

    r16006 r16048  
    146146
    147147    /**
     148     * Non-regression test for bug #18744.
     149     * @throws IOException if any I/O error occurs
     150     * @throws IllegalDataException if OSM parsing fails
     151     */
     152    @Test
     153    public void testTicket18744() throws IOException, IllegalDataException {
     154        try (InputStream is = TestUtils.getRegressionDataStream(18744, "18744-sample.osm")) {
     155            DataSet ds = OsmReader.parseDataSet(is, null);
     156            Layer layer = new OsmDataLayer(ds, null, null);
     157            MainApplication.getLayerManager().addLayer(layer);
     158            try {
     159                assertEquals(3, ds.getWays().size());
     160                new JoinAreasAction(false).join(ds.getWays());
     161                // join should not have changed anything
     162                assertEquals(3, ds.getWays().size());
     163            } finally {
     164                // Ensure we clean the place before leaving, even if test fails.
     165                MainApplication.getLayerManager().removeLayer(layer);
     166            }
     167        }
     168    }
     169
     170
     171    /**
    148172     * Non-regression test which checks example files in nodist/data
    149173     * @throws Exception if an error occurs
Note: See TracChangeset for help on using the changeset viewer.