Changeset 2077 in josm for trunk/test/unit/org
- Timestamp:
- 2009-09-07T23:06:19+02:00 (15 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java
r1951 r2077 14 14 import org.openstreetmap.josm.data.osm.Node; 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 16 17 import org.openstreetmap.josm.data.osm.Relation; 17 18 import org.openstreetmap.josm.data.osm.RelationMember; … … 50 51 assertEquals(2, hull.nodes.size()); 51 52 52 OsmPrimitive p = hull.getPrimitiveById(1 );53 OsmPrimitive p = hull.getPrimitiveById(1,OsmPrimitiveType.NODE); 53 54 assertNotNull(p); 54 55 assertEquals(p.getClass(), Node.class); 55 56 56 p = hull.getPrimitiveById(3 );57 p = hull.getPrimitiveById(3,OsmPrimitiveType.NODE); 57 58 assertNull(p); 58 59 … … 71 72 Node n2 = new Node(2); 72 73 Way w1 = new Way(3); 74 w1.incomplete = false; 73 75 w1.addNode(n1); 74 76 w1.addNode(n2); … … 84 86 assertEquals(2, hull.nodes.size()); 85 87 86 OsmPrimitive p = hull.getPrimitiveById(1 );88 OsmPrimitive p = hull.getPrimitiveById(1,OsmPrimitiveType.NODE); 87 89 assertNotNull(p); 88 90 assertEquals(p.getClass(), Node.class); 89 91 90 p = hull.getPrimitiveById(2 );92 p = hull.getPrimitiveById(2,OsmPrimitiveType.NODE); 91 93 assertNotNull(p); 92 94 assertEquals(p.getClass(), Node.class); 93 95 94 p = hull.getPrimitiveById(3 );96 p = hull.getPrimitiveById(3, OsmPrimitiveType.WAY); 95 97 assertNotNull(p); 96 98 assertEquals(p.getClass(), Way.class); … … 103 105 Node n2 = new Node(2); 104 106 Way w1 = new Way(3); 107 w1.incomplete = false; 105 108 w1.addNode(n1); 106 109 w1.addNode(n2); … … 116 119 assertEquals(2, hull.nodes.size()); 117 120 118 OsmPrimitive p = hull.getPrimitiveById(1 );121 OsmPrimitive p = hull.getPrimitiveById(1,OsmPrimitiveType.NODE); 119 122 assertNotNull(p); 120 123 assertEquals(p.getClass(), Node.class); 121 124 122 p = hull.getPrimitiveById(2 );125 p = hull.getPrimitiveById(2, OsmPrimitiveType.NODE); 123 126 assertNotNull(p); 124 127 assertEquals(p.getClass(), Node.class); 125 128 126 p = hull.getPrimitiveById(3 );129 p = hull.getPrimitiveById(3,OsmPrimitiveType.WAY); 127 130 assertNotNull(p); 128 131 assertEquals(p.getClass(), Way.class); … … 142 145 assertEquals(1, hull.ways.size()); 143 146 144 OsmPrimitive p = hull.getPrimitiveById(3 );147 OsmPrimitive p = hull.getPrimitiveById(3, OsmPrimitiveType.WAY); 145 148 assertNotNull(p); 146 149 assertEquals(p.getClass(), Way.class); … … 154 157 Node n20 = new Node(20); 155 158 r1.addMember(new RelationMember("node-20",n20)); 159 r1.incomplete = false; 156 160 Way w30 = new Way(30); 161 w30.incomplete = false; 157 162 Node n21; 158 163 w30.addNode(n21 = new Node(21)); … … 177 182 assertEquals(2, hull.relations.size()); 178 183 179 OsmPrimitive p = hull.getPrimitiveById(1 );184 OsmPrimitive p = hull.getPrimitiveById(1, OsmPrimitiveType.RELATION); 180 185 assertNotNull(p); 181 186 assertEquals(p.getClass(), Relation.class); 182 187 183 Way w = (Way)hull.getPrimitiveById(30 );188 Way w = (Way)hull.getPrimitiveById(30,OsmPrimitiveType.WAY); 184 189 assertNotNull(w); 185 190 assertEquals(2, w.getNodesCount()); 186 Node n = (Node)hull.getPrimitiveById(21 );191 Node n = (Node)hull.getPrimitiveById(21, OsmPrimitiveType.NODE); 187 192 assertNotNull(n); 188 193 assertTrue(w.containsNode(n)); 189 194 190 n = (Node)hull.getPrimitiveById(22 );195 n = (Node)hull.getPrimitiveById(22,OsmPrimitiveType.NODE); 191 196 assertNotNull(n); 192 197 assertTrue(w.containsNode(n)); 193 198 194 Relation r = (Relation)hull.getPrimitiveById(40 );195 assertNotNull(r); 196 197 r = (Relation)hull.getPrimitiveById(1 );199 Relation r = (Relation)hull.getPrimitiveById(40,OsmPrimitiveType.RELATION); 200 assertNotNull(r); 201 202 r = (Relation)hull.getPrimitiveById(1, OsmPrimitiveType.RELATION); 198 203 assertNotNull(r); 199 204 assertEquals(3, r.getMembersCount()); 200 RelationMember m = new RelationMember("node-20", hull.getPrimitiveById(20 ));201 assertTrue(r.getMembers().contains(m)); 202 m = new RelationMember("way-30", hull.getPrimitiveById(30 ));203 assertTrue(r.getMembers().contains(m)); 204 m = new RelationMember("relation-40", hull.getPrimitiveById(40 ));205 RelationMember m = new RelationMember("node-20", hull.getPrimitiveById(20,OsmPrimitiveType.NODE)); 206 assertTrue(r.getMembers().contains(m)); 207 m = new RelationMember("way-30", hull.getPrimitiveById(30, OsmPrimitiveType.WAY)); 208 assertTrue(r.getMembers().contains(m)); 209 m = new RelationMember("relation-40", hull.getPrimitiveById(40, OsmPrimitiveType.RELATION)); 205 210 assertTrue(r.getMembers().contains(m)); 206 211 } … … 213 218 r1.addMember(new RelationMember("node-20",n20)); 214 219 Way w30 = new Way(30); 220 w30.incomplete = false; 215 221 Node n21; 216 222 w30.addNode(n21 = new Node(21)); … … 235 241 assertEquals(2, hull.relations.size()); 236 242 237 OsmPrimitive p = hull.getPrimitiveById(1 );243 OsmPrimitive p = hull.getPrimitiveById(1, OsmPrimitiveType.RELATION); 238 244 assertNotNull(p); 239 245 assertEquals(p.getClass(), Relation.class); 240 246 241 Way w = (Way)hull.getPrimitiveById(30 );247 Way w = (Way)hull.getPrimitiveById(30, OsmPrimitiveType.WAY); 242 248 assertNotNull(w); 243 249 assertTrue(w.incomplete); 244 250 245 251 246 Node n = (Node)hull.getPrimitiveById(21 );252 Node n = (Node)hull.getPrimitiveById(21,OsmPrimitiveType.NODE); 247 253 assertNull(n); 248 254 249 n = (Node)hull.getPrimitiveById(22 );255 n = (Node)hull.getPrimitiveById(22, OsmPrimitiveType.NODE); 250 256 assertNull(n); 251 257 252 Relation r = (Relation)hull.getPrimitiveById(40 );258 Relation r = (Relation)hull.getPrimitiveById(40, OsmPrimitiveType.RELATION); 253 259 assertNotNull(r); 254 260 assertTrue(r.incomplete); 255 261 256 r = (Relation)hull.getPrimitiveById(1 );262 r = (Relation)hull.getPrimitiveById(1, OsmPrimitiveType.RELATION); 257 263 assertNotNull(r); 258 264 assertEquals(3, r.getMembersCount()); 259 RelationMember m = new RelationMember("node-20", hull.getPrimitiveById(20 ));260 assertTrue(r.getMembers().contains(m)); 261 m = new RelationMember("way-30", hull.getPrimitiveById(30 ));262 assertTrue(r.getMembers().contains(m)); 263 m = new RelationMember("relation-40", hull.getPrimitiveById(40 ));265 RelationMember m = new RelationMember("node-20", hull.getPrimitiveById(20, OsmPrimitiveType.NODE)); 266 assertTrue(r.getMembers().contains(m)); 267 m = new RelationMember("way-30", hull.getPrimitiveById(30, OsmPrimitiveType.WAY)); 268 assertTrue(r.getMembers().contains(m)); 269 m = new RelationMember("relation-40", hull.getPrimitiveById(40, OsmPrimitiveType.RELATION)); 264 270 assertTrue(r.getMembers().contains(m)); 265 271 } … … 272 278 Node n20 = new Node(new LatLon(20.0,20.0)); 273 279 n20.put("name", "n20"); 274 r1.getMembers().add(new RelationMember("node-20",n20)); 280 r1.addMember(new RelationMember("node-20",n20)); 281 275 282 Way w30 = new Way(); 276 283 w30.put("name", "w30"); … … 285 292 r40.put("name", "r40"); 286 293 r1.addMember(new RelationMember("relation-40", r40)); 294 287 295 source.nodes.add(n20); 288 296 source.nodes.add(n21); … … 343 351 assertEquals(1, hull.relations.size()); 344 352 345 Relation r = (Relation)hull.getPrimitiveById(1 );353 Relation r = (Relation)hull.getPrimitiveById(1, OsmPrimitiveType.RELATION); 346 354 assertNotNull(r); 347 355 assertEquals(1, r.getMembersCount()); … … 385 393 assertEquals(2, hull.relations.size()); 386 394 387 r1 = (Relation)hull.getPrimitiveById(1 );395 r1 = (Relation)hull.getPrimitiveById(1, OsmPrimitiveType.RELATION); 388 396 assertNotNull(r1); 389 r2 = (Relation)hull.getPrimitiveById(2 );397 r2 = (Relation)hull.getPrimitiveById(2, OsmPrimitiveType.RELATION); 390 398 assertNotNull(r2); 391 399 assertEquals(1, r1.getMembersCount()); -
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java
r2071 r2077 24 24 import org.openstreetmap.josm.data.osm.Node; 25 25 import org.openstreetmap.josm.data.osm.OsmPrimitive; 26 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 26 27 import org.openstreetmap.josm.data.osm.Relation; 27 28 import org.openstreetmap.josm.data.osm.RelationMember; … … 97 98 visitor.merge(); 98 99 99 Node n2 = (Node)my.getPrimitiveById(1 );100 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 100 101 assertTrue(visitor.getConflicts().isEmpty()); 101 102 assertEquals(1, n2.getId()); … … 133 134 visitor.merge(); 134 135 135 Node n2 = (Node)my.getPrimitiveById(1 );136 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 136 137 assertTrue(visitor.getConflicts().isEmpty()); 137 138 assertEquals(1, n2.getId()); … … 173 174 visitor.merge(); 174 175 175 Node n2 = (Node)my.getPrimitiveById(1 );176 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 176 177 assertEquals(1,visitor.getConflicts().size()); 177 178 assertEquals(n, n2); … … 209 210 visitor.merge(); 210 211 211 Node n2 = (Node)my.getPrimitiveById(1 );212 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 212 213 assertEquals(1,visitor.getConflicts().size()); 213 214 assertEquals(n, n2); … … 242 243 visitor.merge(); 243 244 244 Node n2 = (Node)my.getPrimitiveById(1 );245 Node n2 = (Node)my.getPrimitiveById(1,OsmPrimitiveType.NODE); 245 246 assertEquals(1,visitor.getConflicts().size()); 246 247 assertEquals(true, n2.isVisible()); … … 271 272 visitor.merge(); 272 273 273 Node n2 = (Node)my.getPrimitiveById(1 );274 Node n2 = (Node)my.getPrimitiveById(1, OsmPrimitiveType.NODE); 274 275 assertEquals(0,visitor.getConflicts().size()); 275 276 assertEquals(true, n2.isVisible()); … … 354 355 visitor.merge(); 355 356 356 Node n2 = (Node)my.getPrimitiveById(1 );357 Node n2 = (Node)my.getPrimitiveById(1,OsmPrimitiveType.NODE); 357 358 assertEquals(0,visitor.getConflicts().size()); 358 359 assertEquals(2,my.nodes.size()); … … 501 502 visitor.merge(); 502 503 503 Way merged = (Way)my.getPrimitiveById(3 );504 Way merged = (Way)my.getPrimitiveById(3, OsmPrimitiveType.WAY); 504 505 assertEquals(0,visitor.getConflicts().size()); 505 506 assertEquals("value1",merged.get("key1")); … … 571 572 visitor.merge(); 572 573 573 Way merged = (Way)my.getPrimitiveById(3 );574 Way merged = (Way)my.getPrimitiveById(3, OsmPrimitiveType.WAY); 574 575 assertEquals(0,visitor.getConflicts().size()); 575 576 assertEquals(3,merged.getId()); … … 642 643 visitor.merge(); 643 644 644 Way merged = (Way)my.getPrimitiveById(3 );645 Way merged = (Way)my.getPrimitiveById(3, OsmPrimitiveType.WAY); 645 646 assertEquals(1,visitor.getConflicts().size()); 646 647 assertEquals(3,merged.getId()); … … 690 691 visitor.merge(); 691 692 692 Way merged = (Way)my.getPrimitiveById(3 );693 Way merged = (Way)my.getPrimitiveById(3, OsmPrimitiveType.WAY); 693 694 assertEquals(1,visitor.getConflicts().size()); 694 695 assertEquals(true, visitor.getConflicts().hasConflictForMy(myWay)); … … 851 852 assertEquals(0,visitor.getConflicts().size()); 852 853 853 Way myWay = (Way)my.getPrimitiveById(4 );854 Way myWay = (Way)my.getPrimitiveById(4,OsmPrimitiveType.WAY); 854 855 assertEquals(2, myWay.getNodesCount()); 855 856 856 Node n = (Node)my.getPrimitiveById(1 );857 Node n = (Node)my.getPrimitiveById(1,OsmPrimitiveType.NODE); 857 858 assertTrue(n != null); 858 859 } … … 906 907 assertEquals(0,visitor.getConflicts().size()); 907 908 908 Relation r = (Relation)my.getPrimitiveById(4 );909 Relation r = (Relation)my.getPrimitiveById(4,OsmPrimitiveType.RELATION); 909 910 assertEquals(2, r.getMembersCount()); 910 911 911 Node n = (Node)my.getPrimitiveById(1 );912 Node n = (Node)my.getPrimitiveById(1,OsmPrimitiveType.NODE); 912 913 assertTrue(n != null); 913 914 } … … 942 943 assertEquals(0,visitor.getConflicts().size()); 943 944 944 OsmPrimitive p= my.getPrimitiveById(1 );945 OsmPrimitive p= my.getPrimitiveById(1, OsmPrimitiveType.NODE); 945 946 assertNotNull(p); 946 947 assertTrue(p.incomplete); 947 p= my.getPrimitiveById(2 );948 p= my.getPrimitiveById(2, OsmPrimitiveType.NODE); 948 949 assertNotNull(p); 949 950 assertTrue(p.incomplete); 950 p= my.getPrimitiveById(3 );951 p= my.getPrimitiveById(3, OsmPrimitiveType.WAY); 951 952 assertNotNull(p); 952 953 assertTrue(p.incomplete); 953 954 954 Way w = (Way)my.getPrimitiveById(3 );955 Way w = (Way)my.getPrimitiveById(3, OsmPrimitiveType.WAY); 955 956 assertNotNull(w); 956 957 assertTrue(p.incomplete); … … 1005 1006 assertEquals(0,visitor.getConflicts().size()); 1006 1007 1007 OsmPrimitive p= my.getPrimitiveById(1 );1008 OsmPrimitive p= my.getPrimitiveById(1, OsmPrimitiveType.NODE); 1008 1009 assertNotNull(p); 1009 1010 assertTrue(!p.incomplete); 1010 p= my.getPrimitiveById(2 );1011 p= my.getPrimitiveById(2, OsmPrimitiveType.NODE); 1011 1012 assertNotNull(p); 1012 1013 assertTrue(!p.incomplete); 1013 p= my.getPrimitiveById(3 );1014 p= my.getPrimitiveById(3,OsmPrimitiveType.WAY); 1014 1015 assertNotNull(p); 1015 1016 assertTrue(!p.incomplete); 1016 1017 1017 Way w = (Way)my.getPrimitiveById(3 );1018 Way w = (Way)my.getPrimitiveById(3,OsmPrimitiveType.WAY); 1018 1019 assertNotNull(w); 1019 1020 assertTrue(!p.incomplete); -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r1954 r2077 65 65 66 66 Way myWay = new Way(1); 67 myWay.incomplete = false; 67 68 myWay.addNode(new Node(2)); 68 69 myWay.addNode(new Node(3)); … … 75 76 76 77 assertEquals(1, mergedNodes.size()); 77 assertEquals(2, mergedNodes.get(0). id);78 assertEquals(2, mergedNodes.get(0).getId()); 78 79 79 80 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 89 90 90 91 Way myWay = new Way(1); 92 myWay.incomplete = false; 91 93 myWay.addNode(new Node(2)); 92 94 myWay.addNode(new Node(3)); … … 102 104 mergedNodes = inspectNodeList(model, "Merged"); 103 105 assertEquals(2, mergedNodes.size()); 104 assertEquals(2, mergedNodes.get(0). id);105 assertEquals(1, mergedNodes.get(1). id);106 assertEquals(2, mergedNodes.get(0).getId()); 107 assertEquals(1, mergedNodes.get(1).getId()); 106 108 107 109 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 120 122 121 123 Way myWay = new Way(1); 122 myWay.addNode(new Node(2)); 123 myWay.addNode(new Node(3)); 124 Way theirWay = new Way(1); 124 myWay.incomplete = false; 125 myWay.addNode(new Node(2)); 126 myWay.addNode(new Node(3)); 127 Way theirWay = new Way(1); 128 125 129 126 130 model.populate(myWay, theirWay); … … 133 137 mergedNodes = inspectNodeList(model, "Merged"); 134 138 assertEquals(2, mergedNodes.size()); 135 assertEquals(3, mergedNodes.get(0). id); // my node 3 at position 0136 assertEquals(1, mergedNodes.get(1). id); // already merged node 1 at position 1139 assertEquals(3, mergedNodes.get(0).getId()); // my node 3 at position 0 140 assertEquals(1, mergedNodes.get(1).getId()); // already merged node 1 at position 1 137 141 138 142 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 146 150 147 151 Way myWay = new Way(1); 152 myWay.incomplete = false; 148 153 myWay.addNode(new Node(2)); 149 154 myWay.addNode(new Node(3)); … … 160 165 mergedNodes = inspectNodeList(model, "Merged"); 161 166 assertEquals(3, mergedNodes.size()); 162 assertEquals(3, mergedNodes.get(0). id); // my node 3 at position 0163 assertEquals(4, mergedNodes.get(1). id); // my node 4 at position 1164 assertEquals(1, mergedNodes.get(2). id); // already merged node 1 at position 2167 assertEquals(3, mergedNodes.get(0).getId()); // my node 3 at position 0 168 assertEquals(4, mergedNodes.get(1).getId()); // my node 4 at position 1 169 assertEquals(1, mergedNodes.get(2).getId()); // already merged node 1 at position 2 165 170 166 171 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 174 179 175 180 Way myWay = new Way(1); 181 myWay.incomplete = false; 176 182 myWay.addNode(new Node(2)); 177 183 myWay.addNode(new Node(3)); … … 184 190 185 191 assertEquals(1, mergedNodes.size()); 186 assertEquals(2, mergedNodes.get(0). id);192 assertEquals(2, mergedNodes.get(0).getId()); 187 193 188 194 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 195 201 196 202 Way myWay = new Way(1); 203 myWay.incomplete = false; 197 204 myWay.addNode(new Node(2)); 198 205 myWay.addNode(new Node(3)); … … 208 215 mergedNodes = inspectNodeList(model, "Merged"); 209 216 assertEquals(2, mergedNodes.size()); 210 assertEquals(1, mergedNodes.get(0). id); // already merged node 1 at position 0211 assertEquals(2, mergedNodes.get(1). id); // copied node 2 at position 1217 assertEquals(1, mergedNodes.get(0).getId()); // already merged node 1 at position 0 218 assertEquals(2, mergedNodes.get(1).getId()); // copied node 2 at position 1 212 219 213 220 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 221 228 222 229 Way myWay = new Way(1); 230 myWay.incomplete = false; 223 231 myWay.addNode(new Node(2)); 224 232 myWay.addNode(new Node(3)); … … 234 242 mergedNodes = inspectNodeList(model, "Merged"); 235 243 assertEquals(2, mergedNodes.size()); 236 assertEquals(1, mergedNodes.get(0). id); // already merged node 1 at position 0237 assertEquals(3, mergedNodes.get(1). id); // my node 3 at position 1244 assertEquals(1, mergedNodes.get(0).getId()); // already merged node 1 at position 0 245 assertEquals(3, mergedNodes.get(1).getId()); // my node 3 at position 1 238 246 239 247 … … 248 256 249 257 Way myWay = new Way(1); 258 myWay.incomplete = false; 250 259 myWay.addNode(new Node(2)); 251 260 myWay.addNode(new Node(3)); … … 262 271 mergedNodes = inspectNodeList(model, "Merged"); 263 272 assertEquals(3, mergedNodes.size()); 264 assertEquals(1, mergedNodes.get(0). id); // already merged node 1 at position 0265 assertEquals(3, mergedNodes.get(1). id); // my node 3 at position 1266 assertEquals(4, mergedNodes.get(2). id); // my node 4 at position 2273 assertEquals(1, mergedNodes.get(0).getId()); // already merged node 1 at position 0 274 assertEquals(3, mergedNodes.get(1).getId()); // my node 3 at position 1 275 assertEquals(4, mergedNodes.get(2).getId()); // my node 4 at position 2 267 276 268 277 … … 280 289 281 290 Way myWay = new Way(1); 291 myWay.incomplete = false; 282 292 myWay.addNode(new Node(1)); 283 293 myWay.addNode(new Node(2)); … … 293 303 294 304 assertEquals(4, mergedNodes.size()); 295 assertEquals(10, mergedNodes.get(0). id); // already merged node296 assertEquals(1, mergedNodes.get(1). id); // copied node 1 at position 1297 assertEquals(11, mergedNodes.get(2). id); // already merged node298 assertEquals(12, mergedNodes.get(3). id); // already merged node305 assertEquals(10, mergedNodes.get(0).getId()); // already merged node 306 assertEquals(1, mergedNodes.get(1).getId()); // copied node 1 at position 1 307 assertEquals(11, mergedNodes.get(2).getId()); // already merged node 308 assertEquals(12, mergedNodes.get(3).getId()); // already merged node 299 309 300 310 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 308 318 309 319 Way myWay = new Way(1); 320 myWay.incomplete = false; 310 321 myWay.addNode(new Node(1)); 311 322 myWay.addNode(new Node(2)); … … 321 332 322 333 assertEquals(5, mergedNodes.size()); 323 assertEquals(1, mergedNodes.get(0). id); // copied node 1 at position 0324 assertEquals(2, mergedNodes.get(1). id); // copied node 2 at position 1325 assertEquals(10, mergedNodes.get(2). id); // already merged node326 assertEquals(11, mergedNodes.get(3). id); // already merged node327 assertEquals(12, mergedNodes.get(4). id); // already merged node334 assertEquals(1, mergedNodes.get(0).getId()); // copied node 1 at position 0 335 assertEquals(2, mergedNodes.get(1).getId()); // copied node 2 at position 1 336 assertEquals(10, mergedNodes.get(2).getId()); // already merged node 337 assertEquals(11, mergedNodes.get(3).getId()); // already merged node 338 assertEquals(12, mergedNodes.get(4).getId()); // already merged node 328 339 329 340 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 336 347 337 348 Way myWay = new Way(1); 349 myWay.incomplete = false; 338 350 myWay.addNode(new Node(1)); 339 351 myWay.addNode(new Node(2)); … … 369 381 370 382 Way myWay = new Way(1); 383 myWay.incomplete = false; 371 384 myWay.addNode(new Node(1)); 372 385 myWay.addNode(new Node(2)); … … 382 395 383 396 assertEquals(4, mergedNodes.size()); 384 assertEquals(10, mergedNodes.get(0). id); // already merged node385 assertEquals(11, mergedNodes.get(1). id); // already merged node386 assertEquals(1, mergedNodes.get(2). id); // copied node 1 at position 2387 assertEquals(12, mergedNodes.get(3). id); // already merged node397 assertEquals(10, mergedNodes.get(0).getId()); // already merged node 398 assertEquals(11, mergedNodes.get(1).getId()); // already merged node 399 assertEquals(1, mergedNodes.get(2).getId()); // copied node 1 at position 2 400 assertEquals(12, mergedNodes.get(3).getId()); // already merged node 388 401 389 402 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 397 410 398 411 Way myWay = new Way(1); 412 myWay.incomplete = false; 399 413 myWay.addNode(new Node(1)); 400 414 myWay.addNode(new Node(2)); … … 411 425 412 426 assertEquals(5, mergedNodes.size()); 413 assertEquals(10, mergedNodes.get(0). id); // already merged node414 assertEquals(11, mergedNodes.get(1). id); // already merged node415 assertEquals(12, mergedNodes.get(2). id); // already merged node416 assertEquals(1, mergedNodes.get(3). id); // copied node 1 at position 3417 assertEquals(2, mergedNodes.get(4). id); // copied node 2 at position 4427 assertEquals(10, mergedNodes.get(0).getId()); // already merged node 428 assertEquals(11, mergedNodes.get(1).getId()); // already merged node 429 assertEquals(12, mergedNodes.get(2).getId()); // already merged node 430 assertEquals(1, mergedNodes.get(3).getId()); // copied node 1 at position 3 431 assertEquals(2, mergedNodes.get(4).getId()); // copied node 2 at position 4 418 432 419 433 … … 427 441 428 442 Way myWay = new Way(1); 443 myWay.incomplete = false; 429 444 myWay.addNode(new Node(1)); 430 445 myWay.addNode(new Node(2)); … … 441 456 442 457 assertEquals(5, mergedNodes.size()); 443 assertEquals(10, mergedNodes.get(0). id); // already merged node444 assertEquals(1, mergedNodes.get(1). id); // copied node 1 at position 1445 assertEquals(3, mergedNodes.get(2). id); // copied node 3 at position 2446 assertEquals(11, mergedNodes.get(3). id); // already merged node447 assertEquals(12, mergedNodes.get(4). id); // already merged node458 assertEquals(10, mergedNodes.get(0).getId()); // already merged node 459 assertEquals(1, mergedNodes.get(1).getId()); // copied node 1 at position 1 460 assertEquals(3, mergedNodes.get(2).getId()); // copied node 3 at position 2 461 assertEquals(11, mergedNodes.get(3).getId()); // already merged node 462 assertEquals(12, mergedNodes.get(4).getId()); // already merged node 448 463 449 464 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 456 471 457 472 Way myWay = new Way(1); 473 myWay.incomplete = false; 458 474 myWay.addNode(new Node(1)); 459 475 myWay.addNode(new Node(2)); … … 489 505 490 506 Way myWay = new Way(1); 507 myWay.incomplete = false; 491 508 myWay.addNode(new Node(1)); 492 509 myWay.addNode(new Node(2)); … … 502 519 503 520 assertEquals(3, mergedNodes.size()); 504 assertEquals(11, mergedNodes.get(0). id);505 assertEquals(10, mergedNodes.get(1). id);506 assertEquals(12, mergedNodes.get(2). id);521 assertEquals(11, mergedNodes.get(0).getId()); 522 assertEquals(10, mergedNodes.get(1).getId()); 523 assertEquals(12, mergedNodes.get(2).getId()); 507 524 508 525 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 515 532 516 533 Way myWay = new Way(1); 534 myWay.incomplete = false; 517 535 myWay.addNode(new Node(1)); 518 536 myWay.addNode(new Node(2)); … … 530 548 531 549 assertEquals(5, mergedNodes.size()); 532 assertEquals(11, mergedNodes.get(0). id);533 assertEquals(10, mergedNodes.get(1). id);534 assertEquals(12, mergedNodes.get(2). id);535 assertEquals(14, mergedNodes.get(3). id);536 assertEquals(13, mergedNodes.get(4). id);550 assertEquals(11, mergedNodes.get(0).getId()); 551 assertEquals(10, mergedNodes.get(1).getId()); 552 assertEquals(12, mergedNodes.get(2).getId()); 553 assertEquals(14, mergedNodes.get(3).getId()); 554 assertEquals(13, mergedNodes.get(4).getId()); 537 555 538 556 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 545 563 546 564 Way myWay = new Way(1); 565 myWay.incomplete = false; 547 566 myWay.addNode(new Node(1)); 548 567 myWay.addNode(new Node(2)); … … 560 579 561 580 assertEquals(5, mergedNodes.size()); 562 assertEquals(11, mergedNodes.get(0). id);563 assertEquals(12, mergedNodes.get(1). id);564 assertEquals(13, mergedNodes.get(2). id);565 assertEquals(14, mergedNodes.get(3). id);566 assertEquals(10, mergedNodes.get(4). id);581 assertEquals(11, mergedNodes.get(0).getId()); 582 assertEquals(12, mergedNodes.get(1).getId()); 583 assertEquals(13, mergedNodes.get(2).getId()); 584 assertEquals(14, mergedNodes.get(3).getId()); 585 assertEquals(10, mergedNodes.get(4).getId()); 567 586 568 587 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 578 597 579 598 Way myWay = new Way(1); 599 myWay.incomplete = false; 580 600 myWay.addNode(new Node(1)); 581 601 myWay.addNode(new Node(2)); … … 591 611 592 612 assertEquals(3, mergedNodes.size()); 593 assertEquals(10, mergedNodes.get(0). id);594 assertEquals(12, mergedNodes.get(1). id);595 assertEquals(11, mergedNodes.get(2). id);613 assertEquals(10, mergedNodes.get(0).getId()); 614 assertEquals(12, mergedNodes.get(1).getId()); 615 assertEquals(11, mergedNodes.get(2).getId()); 596 616 597 617 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 604 624 605 625 Way myWay = new Way(1); 626 myWay.incomplete = false; 606 627 myWay.addNode(new Node(1)); 607 628 myWay.addNode(new Node(2)); … … 619 640 620 641 assertEquals(5, mergedNodes.size()); 621 assertEquals(10, mergedNodes.get(0). id);622 assertEquals(12, mergedNodes.get(1). id);623 assertEquals(11, mergedNodes.get(2). id);624 assertEquals(14, mergedNodes.get(3). id);625 assertEquals(13, mergedNodes.get(4). id);642 assertEquals(10, mergedNodes.get(0).getId()); 643 assertEquals(12, mergedNodes.get(1).getId()); 644 assertEquals(11, mergedNodes.get(2).getId()); 645 assertEquals(14, mergedNodes.get(3).getId()); 646 assertEquals(13, mergedNodes.get(4).getId()); 626 647 627 648 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel"); … … 634 655 635 656 Way myWay = new Way(1); 657 myWay.incomplete = false; 636 658 myWay.addNode(new Node(1)); 637 659 myWay.addNode(new Node(2)); … … 649 671 650 672 assertEquals(5, mergedNodes.size()); 651 assertEquals(10, mergedNodes.get(0). id);652 assertEquals(14, mergedNodes.get(1). id);653 assertEquals(11, mergedNodes.get(2). id);654 assertEquals(12, mergedNodes.get(3). id);655 assertEquals(13, mergedNodes.get(4). id);673 assertEquals(10, mergedNodes.get(0).getId()); 674 assertEquals(14, mergedNodes.get(1).getId()); 675 assertEquals(11, mergedNodes.get(2).getId()); 676 assertEquals(12, mergedNodes.get(3).getId()); 677 assertEquals(13, mergedNodes.get(4).getId()); 656 678 657 679 DefaultListSelectionModel mergedSelection = inspectListSelectionModel(model, "mergedEntriesSelectionModel");
Note:
See TracChangeset
for help on using the changeset viewer.