Ignore:
Timestamp:
2023-09-21T20:29:59+02:00 (14 months ago)
Author:
taylor.smock
Message:

Revert r18838, see #23008: natural=coastline does not work well with the changes

This adds a test to ensure future changes don't break the natural=coastline
branch.

File:
1 edited

Legend:

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

    r18675 r18840  
    55import static org.junit.jupiter.api.Assertions.assertFalse;
    66import static org.junit.jupiter.api.Assertions.assertTrue;
     7
     8import java.util.ArrayList;
    79
    810import org.junit.jupiter.api.BeforeEach;
     
    1618import org.openstreetmap.josm.data.osm.TagMap;
    1719import org.openstreetmap.josm.data.osm.Way;
     20import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1821import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1922import org.openstreetmap.josm.testutils.annotations.Projection;
     
    130133        assertDoesNotThrow(() -> this.powerLines.visit(powerLine));
    131134    }
     135
     136    @Test
     137    void testPowerlineCrossingOcean() {
     138        final Way powerLine = TestUtils.newWay("power=line",
     139                new Node(new LatLon(52.6759313, 8.3845078)),
     140                new Node(new LatLon(52.6759857, 8.3898977)),
     141                new Node(new LatLon(52.6759857, 8.3949282)),
     142                new Node(new LatLon(52.6758768, 8.3978927)),
     143                new Node(new LatLon(52.6759313, 8.4322981)),
     144                new Node(new LatLon(52.6759857, 8.4419999)),
     145                new Node(new LatLon(52.6758768, 8.4488271)));
     146        final Way coastline = TestUtils.newWay("natural=coastline",
     147                new Node(new LatLon(52.6813231, 8.4253811)),
     148                new Node(new LatLon(52.6684687, 8.4254709)),
     149                new Node(new LatLon(52.6680328, 8.4033724)),
     150                new Node(new LatLon(52.6838282, 8.4070555)));
     151        for (Node node : powerLine.getNodes()) {
     152            node.put("power", "tower");
     153        }
     154        this.ds.addPrimitiveRecursive(powerLine);
     155        this.ds.addPrimitiveRecursive(coastline);
     156
     157        this.powerLines.startTest(NullProgressMonitor.INSTANCE);
     158        this.powerLines.visit(new ArrayList<>(ds.getWays()));
     159        this.powerLines.endTest();
     160        assertTrue(this.powerLines.getErrors().isEmpty());
     161    }
    132162}
Note: See TracChangeset for help on using the changeset viewer.