Changeset 1751 in josm for trunk/test
- Timestamp:
- 2009-07-08T22:06:58+02:00 (15 years ago)
- Location:
- trunk/test/unit
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java
r1750 r1751 33 33 @BeforeClass 34 34 static public void init() { 35 testProperties = new Properties(); 36 37 // load properties 38 // 39 try { 40 testProperties.load(MergeVisitorTest.class.getResourceAsStream("/test-unit-env.properties")); 41 } catch(Exception e){ 42 logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties")); 43 fail(MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties")); 35 36 if(System.getProperty("josm.home") == null){ 37 testProperties = new Properties(); 38 39 // load properties 40 // 41 try { 42 testProperties.load(MergeVisitorTest.class.getResourceAsStream("/test-unit-env.properties")); 43 } catch(Exception e){ 44 logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties")); 45 fail(MessageFormat.format("failed to load property file ''{0}''", "/test-unit-env.properties")); 46 } 47 48 // check josm.home 49 // 50 String josmHome = testProperties.getProperty("josm.home"); 51 if (josmHome == null) { 52 fail(MessageFormat.format("property ''{0}'' not set in test environment", "josm.home")); 53 } else { 54 File f = new File(josmHome); 55 if (! f.exists() || ! f.canRead()) { 56 fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing or not readable", "josm.home", josmHome)); 57 } 58 } 59 System.setProperty("josm.home", josmHome); 44 60 } 45 46 // check josm.home47 //48 String josmHome = testProperties.getProperty("josm.home");49 if (josmHome == null) {50 fail(MessageFormat.format("property ''{0}'' not set in test environment", "josm.home"));51 } else {52 File f = new File(josmHome);53 if (! f.exists() || ! f.canRead()) {54 fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing or not readable", "josm.home", josmHome));55 }56 }57 System.setProperty("josm.home", josmHome);58 61 Main.pleaseWaitDlg = new PleaseWaitDialog(null); 59 62 Main.pref.init(false); … … 65 68 /** 66 69 * two identical nodes, even in id and version. No confict expected. 67 * 70 * 68 71 * Can happen if data is loaded in two layers and then merged from one layer 69 72 * on the other. … … 104 107 * two nodes, my is unmodified, their is updated and has a higher version 105 108 * => their version is going to be the merged version 106 * 109 * 107 110 */ 108 111 @Test … … 143 146 * node with same id, my is modified, their has a higher version 144 147 * => results in a conflict 145 * 148 * 146 149 * Use case: node which is modified locally and updated by another mapper on 147 150 * the server … … 181 184 * node with same id, my is deleted, their has a higher version 182 185 * => results in a conflict 183 * 186 * 184 187 * Use case: node which is deleted locally and updated by another mapper on 185 188 * the server … … 217 220 * My node is visible, their version has a higher version and is not visible 218 221 * => create a conflict 219 * 222 * 220 223 */ 221 224 @Test … … 251 254 * My node is deleted, their node has the same id and version and is not deleted. 252 255 * => mine has precedence 253 * 256 * 254 257 */ 255 258 @Test … … 281 284 /** 282 285 * My and their node are new but semantically equal. My node is deleted. 283 * 286 * 284 287 * => create a conflict 285 * 288 * 286 289 */ 287 290 @Test … … 309 312 /** 310 313 * My and their node are new but semantically equal. Both are deleted. 311 * 314 * 312 315 * => take mine 313 * 316 * 314 317 */ 315 318 @Test … … 339 342 * their node is not visible and doesn't exist in my data set 340 343 * => ignore their node 341 * 344 * 342 345 */ 343 346 @Test … … 372 375 * their node has no assigned id (id == 0) and is semantically equal to one of my 373 376 * nodes with id == 0 374 * 377 * 375 378 * => merge it onto my node. 376 * 379 * 377 380 */ 378 381 @Test … … 422 425 /** 423 426 * my node is incomplete, their node is complete 424 * 427 * 425 428 * => merge it onto my node. My node becomes complete 426 * 429 * 427 430 */ 428 431 @Test … … 461 464 * their way has a higher version and different tags. the nodes are the same. My 462 465 * way is not modified. Merge is possible. No conflict. 463 * 466 * 464 467 * => merge it onto my way. 465 * 468 * 466 469 */ 467 470 @Test … … 531 534 * their way has a higher version and different tags. And it has more nodes. Two 532 535 * of the existing nodes are modified. 533 * 536 * 534 537 * => merge it onto my way, no conflict 535 * 538 * 536 539 */ 537 540 @Test … … 605 608 /** 606 609 * their way has a higher version and different nodes. My way is modified. 607 * 610 * 608 611 * => merge it onto my way not possbile, conflict 609 * 612 * 610 613 */ 611 614 @Test … … 681 684 /** 682 685 * their way is not visible anymore. 683 * 686 * 684 687 * => conflict 685 * 688 * 686 689 */ 687 690 @Test … … 731 734 * my and their way are semantically equal. so technical attributes of 732 735 * their way can be merged on my way. No conflict. 733 * 734 * 735 * 736 * 737 * 738 * 736 739 */ 737 740 @Test … … 795 798 * my and their way are semantically equal. so technical attributes of 796 799 * their way can be merged on my way. No conflict. 797 * 800 * 798 801 */ 799 802 @Test
Note:
See TracChangeset
for help on using the changeset viewer.