Changeset 12727 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2017-09-05T00:03:28+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java
r12726 r12727 103 103 @Test 104 104 public void testReferredDelete() { 105 DeleteCommand.deleteWithReferences( testData.layer,Arrays.asList(testData.existingNode), true).executeCommand();105 DeleteCommand.deleteWithReferences(Arrays.asList(testData.existingNode), true).executeCommand(); 106 106 107 107 assertTrue(testData.existingNode.isDeleted()); … … 206 206 207 207 /** 208 * Test {@link DeleteCommand#deleteWaySegment( OsmDataLayer, org.openstreetmap.josm.data.osm.WaySegment)}208 * Test {@link DeleteCommand#deleteWaySegment(WaySegment)} 209 209 * Way with only 1 segment 210 210 */ … … 213 213 Way way1 = testData.createWay(100, testData.createNode(101), testData.createNode(102)); 214 214 WaySegment ws = new WaySegment(way1, 0); 215 Command command = DeleteCommand.deleteWaySegment( testData.layer,ws);215 Command command = DeleteCommand.deleteWaySegment(ws); 216 216 command.executeCommand(); 217 217 … … 220 220 221 221 /** 222 * Test {@link DeleteCommand#deleteWaySegment( OsmDataLayer, org.openstreetmap.josm.data.osm.WaySegment)}222 * Test {@link DeleteCommand#deleteWaySegment(WaySegment)} 223 223 * Delete end of way 224 224 */ … … 228 228 testData.createNode(204)); 229 229 WaySegment ws = new WaySegment(way, 2); 230 Command command = DeleteCommand.deleteWaySegment( testData.layer,ws);230 Command command = DeleteCommand.deleteWaySegment(ws); 231 231 command.executeCommand(); 232 232 … … 238 238 239 239 /** 240 * Test {@link DeleteCommand#deleteWaySegment( OsmDataLayer, org.openstreetmap.josm.data.osm.WaySegment)}240 * Test {@link DeleteCommand#deleteWaySegment(WaySegment)} 241 241 * Delete start of way 242 242 */ … … 246 246 testData.createNode(104)); 247 247 WaySegment ws = new WaySegment(way, 0); 248 Command command = DeleteCommand.deleteWaySegment( testData.layer,ws);248 Command command = DeleteCommand.deleteWaySegment(ws); 249 249 command.executeCommand(); 250 250 … … 256 256 257 257 /** 258 * Test {@link DeleteCommand#deleteWaySegment( OsmDataLayer, org.openstreetmap.josm.data.osm.WaySegment)}258 * Test {@link DeleteCommand#deleteWaySegment(WaySegment)} 259 259 * Delete start of way 260 260 */ … … 265 265 Way way = testData.createWay(100, testData.createNode(101), testData.createNode(102), node103, node104); 266 266 WaySegment ws = new WaySegment(way, 1); 267 Command command = DeleteCommand.deleteWaySegment( testData.layer,ws);267 Command command = DeleteCommand.deleteWaySegment(ws); 268 268 command.executeCommand(); 269 269 … … 280 280 281 281 /** 282 * Test {@link DeleteCommand#deleteWaySegment( OsmDataLayer, org.openstreetmap.josm.data.osm.WaySegment)}282 * Test {@link DeleteCommand#deleteWaySegment(WaySegment)} 283 283 * Delete start of way 284 284 */ … … 289 289 testData.createNode(104), n); 290 290 WaySegment ws = new WaySegment(way, 2); 291 Command command = DeleteCommand.deleteWaySegment( testData.layer,ws);291 Command command = DeleteCommand.deleteWaySegment(ws); 292 292 command.executeCommand(); 293 293 -
trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java
r10758 r12727 62 62 // to check that algorithm ignores it: 63 63 Relation relationParent3 = testData.createRelation(102, new RelationMember("child", testData.existingRelation)); 64 PurgeCommand command = new PurgeCommand(testData.layer ,64 PurgeCommand command = new PurgeCommand(testData.layer.data, 65 65 Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingNode2, testData.existingWay, 66 66 testData.existingRelation, relationParent, relationParent2), … … 83 83 @Test 84 84 public void testUndo() { 85 PurgeCommand command = new PurgeCommand(testData.layer ,85 PurgeCommand command = new PurgeCommand(testData.layer.data, 86 86 Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingWay), 87 87 Arrays.<OsmPrimitive>asList(testData.existingWay)); … … 107 107 ArrayList<OsmPrimitive> deleted = new ArrayList<>(); 108 108 ArrayList<OsmPrimitive> added = new ArrayList<>(); 109 PurgeCommand command = new PurgeCommand(testData.layer , Arrays.<OsmPrimitive>asList(testData.existingNode),109 PurgeCommand command = new PurgeCommand(testData.layer.data, Arrays.<OsmPrimitive>asList(testData.existingNode), 110 110 Arrays.<OsmPrimitive>asList(testData.existingRelation)); 111 111 command.fillModifiedData(modified, deleted, added); … … 121 121 @Test 122 122 public void testGetParticipatingPrimitives() { 123 PurgeCommand command = new PurgeCommand(testData.layer , Arrays.<OsmPrimitive>asList(testData.existingNode),123 PurgeCommand command = new PurgeCommand(testData.layer.data, Arrays.<OsmPrimitive>asList(testData.existingNode), 124 124 Arrays.<OsmPrimitive>asList(testData.existingRelation)); 125 125 assertArrayEquals(new Object[] {testData.existingNode }, command.getParticipatingPrimitives().toArray()); … … 132 132 public void testDescription() { 133 133 List<OsmPrimitive> shortList = Arrays.<OsmPrimitive>asList(testData.existingWay); 134 assertTrue(new PurgeCommand(testData.layer , shortList, Arrays.<OsmPrimitive>asList()).getDescriptionText()134 assertTrue(new PurgeCommand(testData.layer.data, shortList, Arrays.<OsmPrimitive>asList()).getDescriptionText() 135 135 .matches("Purged 1 object")); 136 136 List<OsmPrimitive> longList = Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingNode2, 137 137 testData.existingWay); 138 assertTrue(new PurgeCommand(testData.layer , longList, Arrays.<OsmPrimitive>asList()).getDescriptionText()138 assertTrue(new PurgeCommand(testData.layer.data, longList, Arrays.<OsmPrimitive>asList()).getDescriptionText() 139 139 .matches("Purged 3 objects")); 140 140 }
Note:
See TracChangeset
for help on using the changeset viewer.