Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r15610 r16202 144 144 } 145 145 innerMap.put(ws.lowerIndex, node); 146 seenWays.add(ws.way); 146 147 } 147 seenWays.add(ws.way);148 148 } 149 149 } -
trunk/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java
r15610 r16202 17 17 import org.openstreetmap.josm.data.osm.DataSet; 18 18 import org.openstreetmap.josm.data.osm.Node; 19 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 20 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 19 21 import org.openstreetmap.josm.data.osm.Way; 20 22 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 213 215 } 214 216 217 /** 218 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18990">Bug #18990</a>. 219 * @throws Exception if an error occurs 220 */ 221 @Test 222 public void testTicket18990() throws Exception { 223 DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(18990, "18990-sample.osm"), null); 224 Layer layer = new OsmDataLayer(ds, OsmDataLayer.createNewName(), null); 225 MainApplication.getLayerManager().addLayer(layer); 226 try { 227 Node toMove = (Node) ds.getPrimitiveById(new SimplePrimitiveId(7018586511L, OsmPrimitiveType.NODE)); 228 assertTrue(toMove != null); 229 Node expected = new Node(new LatLon(43.48582074476985, -96.76897750613033)); 230 231 ds.setSelected(toMove); 232 setupMapView(ds); 233 JoinNodeWayAction action = JoinNodeWayAction.createMoveNodeOntoWayAction(); 234 action.setEnabled(true); 235 action.actionPerformed(null); 236 assertTrue("Node was moved to an unexpected position", toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7)); 237 assertTrue("Node was not added to expected way", toMove.getParentWays().size() == 1); 238 assertTrue("Node was not added to expected way segment", 239 toMove.getParentWays().iterator().next().getNodes().indexOf(toMove) == 2); 240 } finally { 241 MainApplication.getLayerManager().removeLayer(layer); 242 } 243 } 244 215 245 }
Note:
See TracChangeset
for help on using the changeset viewer.