Changeset 1650 in josm for trunk/test/unit/org/openstreetmap/josm
 Timestamp:
 20090607T15:04:28+02:00 (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r1631 r1650 3 3 4 4 import static org.fest.reflect.core.Reflection.field; 5 import static org.fest.reflect.core.Reflection.method; 5 6 import static org.junit.Assert.assertEquals; 6 7 import static org.junit.Assert.assertTrue; … … 21 22 22 23 protected List<Node> inspectNodeList(NodeListMergeModel model, String name) { 23 return field(name).ofType(ArrayList.class) 24 return method("get" + name + "Entries") 25 .withReturnType(List.class) 24 26 .in(model) 25 . get();27 .invoke(); 26 28 } 27 29 … … 69 71 model.copyMyToTop(new int[]{0}); 70 72 71 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");73 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 72 74 73 75 assertEquals(1, mergedNodes.size()); … … 92 94 model.populate(myWay, theirWay); 93 95 94 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");96 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 95 97 mergedNodes.add(new Node(1)); 96 98 97 99 model.copyMyToTop(new int[]{0}); 98 100 99 mergedNodes = inspectNodeList(model, " mergedEntries");101 mergedNodes = inspectNodeList(model, "Merged"); 100 102 assertEquals(2, mergedNodes.size()); 101 103 assertEquals(2, mergedNodes.get(0).id); … … 123 125 model.populate(myWay, theirWay); 124 126 125 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");127 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 126 128 mergedNodes.add(new Node(1)); 127 129 128 130 model.copyMyToTop(new int[]{1}); // copy node 3 129 131 130 mergedNodes = inspectNodeList(model, " mergedEntries");132 mergedNodes = inspectNodeList(model, "Merged"); 131 133 assertEquals(2, mergedNodes.size()); 132 134 assertEquals(3, mergedNodes.get(0).id); // my node 3 at position 0 … … 150 152 model.populate(myWay, theirWay); 151 153 152 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");154 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 153 155 mergedNodes.add(new Node(1)); 154 156 155 157 model.copyMyToTop(new int[]{1,2}); // copy node 3 and 4 156 158 157 mergedNodes = inspectNodeList(model, " mergedEntries");159 mergedNodes = inspectNodeList(model, "Merged"); 158 160 assertEquals(3, mergedNodes.size()); 159 161 assertEquals(3, mergedNodes.get(0).id); // my node 3 at position 0 … … 178 180 model.copyMyToEnd(new int[]{0}); 179 181 180 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");182 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 181 183 182 184 assertEquals(1, mergedNodes.size()); … … 198 200 model.populate(myWay, theirWay); 199 201 200 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");202 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 201 203 mergedNodes.add(new Node(1)); 202 204 203 205 model.copyMyToEnd(new int[]{0}); 204 206 205 mergedNodes = inspectNodeList(model, " mergedEntries");207 mergedNodes = inspectNodeList(model, "Merged"); 206 208 assertEquals(2, mergedNodes.size()); 207 209 assertEquals(1, mergedNodes.get(0).id); // already merged node 1 at position 0 … … 224 226 model.populate(myWay, theirWay); 225 227 226 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");228 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 227 229 mergedNodes.add(new Node(1)); 228 230 229 231 model.copyMyToEnd(new int[]{1}); // copy node 3 230 232 231 mergedNodes = inspectNodeList(model, " mergedEntries");233 mergedNodes = inspectNodeList(model, "Merged"); 232 234 assertEquals(2, mergedNodes.size()); 233 235 assertEquals(1, mergedNodes.get(0).id); // already merged node 1 at position 0 … … 252 254 model.populate(myWay, theirWay); 253 255 254 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");256 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 255 257 mergedNodes.add(new Node(1)); 256 258 257 259 model.copyMyToEnd(new int[]{1,2}); // copy node 3 and 4 258 260 259 mergedNodes = inspectNodeList(model, " mergedEntries");261 mergedNodes = inspectNodeList(model, "Merged"); 260 262 assertEquals(3, mergedNodes.size()); 261 263 assertEquals(1, mergedNodes.get(0).id); // already merged node 1 at position 0 … … 282 284 283 285 model.populate(myWay, theirWay); 284 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");286 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 285 287 mergedNodes.add(new Node(10)); 286 288 mergedNodes.add(new Node(11)); … … 310 312 311 313 model.populate(myWay, theirWay); 312 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");314 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 313 315 mergedNodes.add(new Node(10)); 314 316 mergedNodes.add(new Node(11)); … … 338 340 339 341 model.populate(myWay, theirWay); 340 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");342 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 341 343 mergedNodes.add(new Node(10)); 342 344 mergedNodes.add(new Node(11)); … … 371 373 372 374 model.populate(myWay, theirWay); 373 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");375 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 374 376 mergedNodes.add(new Node(10)); 375 377 mergedNodes.add(new Node(11)); … … 400 402 401 403 model.populate(myWay, theirWay); 402 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");404 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 403 405 mergedNodes.add(new Node(10)); 404 406 mergedNodes.add(new Node(11)); … … 430 432 431 433 model.populate(myWay, theirWay); 432 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");434 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 433 435 mergedNodes.add(new Node(10)); 434 436 mergedNodes.add(new Node(11)); … … 458 460 459 461 model.populate(myWay, theirWay); 460 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");462 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 461 463 mergedNodes.add(new Node(10)); 462 464 mergedNodes.add(new Node(11)); … … 491 493 492 494 model.populate(myWay, theirWay); 493 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");495 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 494 496 mergedNodes.add(new Node(10)); 495 497 mergedNodes.add(new Node(11)); … … 517 519 518 520 model.populate(myWay, theirWay); 519 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");521 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 520 522 mergedNodes.add(new Node(10)); 521 523 mergedNodes.add(new Node(11)); … … 547 549 548 550 model.populate(myWay, theirWay); 549 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");551 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 550 552 mergedNodes.add(new Node(10)); 551 553 mergedNodes.add(new Node(11)); … … 580 582 581 583 model.populate(myWay, theirWay); 582 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");584 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 583 585 mergedNodes.add(new Node(10)); 584 586 mergedNodes.add(new Node(11)); … … 606 608 607 609 model.populate(myWay, theirWay); 608 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");610 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 609 611 mergedNodes.add(new Node(10)); 610 612 mergedNodes.add(new Node(11)); … … 636 638 637 639 model.populate(myWay, theirWay); 638 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");640 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 639 641 mergedNodes.add(new Node(10)); 640 642 mergedNodes.add(new Node(11));
Note: See TracChangeset
for help on using the changeset viewer.