Changeset 15777 in josm for trunk/test/unit
- Timestamp:
- 2020-01-26T19:45:25+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
r14138 r15777 15 15 import org.openstreetmap.josm.data.osm.Node; 16 16 import org.openstreetmap.josm.data.osm.User; 17 import org.openstreetmap.josm.data.osm.Way; 17 18 import org.openstreetmap.josm.gui.MainApplication; 18 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 48 49 DataSet ds = new DataSet(); 49 50 assertEquals("", InspectPrimitiveDialog.buildDataText(ds, new ArrayList<>(ds.allPrimitives()))); 50 Node n = new Node(LatLon.ZERO); 51 n.setOsmId(1, 1); 52 ds.addPrimitive(n); 51 final Way way = new Way(); 52 way.addNode(new Node(new LatLon(47.2687921, 11.390525))); 53 way.addNode(new Node(new LatLon(47.2689194, 11.3907301))); 54 way.addNode(new Node(new LatLon(47.2684158, 11.3914047))); 55 way.addNode(new Node(new LatLon(47.2682898, 11.3912034))); 56 way.setOsmId(1, 1); 57 int id = 2; 58 for (Node node : way.getNodes()) { 59 node.setOsmId(id, id); 60 id++; 61 } 62 way.getNodes().forEach(ds::addPrimitive); 63 ds.addPrimitive(way); 64 way.addNode(way.firstNode()); // close way 53 65 assertEquals( 54 "Node: 1\n" +66 "Way: 1\n" + 55 67 " Data Set: "+Integer.toHexString(ds.hashCode())+"\n" + 56 68 " Edited at: <new object>\n" + … … 58 70 " Version: 1\n" + 59 71 " In changeset: 0\n" + 60 " Coordinates: 0.0, 0.0\n" + 61 " Coordinates (projected): 0.0, -7.081154551613622E-10\n" + 62 " UTM Zone: 31S\n" + 63 "\n", InspectPrimitiveDialog.buildDataText(ds, new ArrayList<>(ds.allPrimitives()))); 72 " Bounding box: 47.2682898, 11.3914047, 47.2689194, 11.390525\n" + 73 " Bounding box (projected): 5985976.274977, 1268085.3706241, 5986079.5621105, 1267987.4428681\n" + 74 " Center of bounding box: 47.2686046, 11.3909648\n" + 75 " Centroid: 47.2686049, 11.3909649\n" + 76 " 5 Nodes: \n" + 77 " 2\n" + 78 " 3\n" + 79 " 4\n" + 80 " 5\n" + 81 " 2\n" + 82 "\n", InspectPrimitiveDialog.buildDataText(ds, new ArrayList<>(ds.getWays()))); 64 83 } 65 84
Note:
See TracChangeset
for help on using the changeset viewer.