Changeset 18444 in josm for trunk/test
- Timestamp:
- 2022-05-10T18:54:08+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/ImageDataTest.java
r18049 r18444 45 45 assertEquals(0, data.getImages().size()); 46 46 assertNull(data.getSelectedImage()); 47 data.se lectFirstImage();47 data.setSelectedImage(data.getFirstImage()); 48 48 assertNull(data.getSelectedImage()); 49 data.se lectLastImage();49 data.setSelectedImage(data.getLastImage()); 50 50 assertNull(data.getSelectedImage()); 51 data.se lectFirstImage();51 data.setSelectedImage(data.getFirstImage()); 52 52 assertNull(data.getSelectedImage()); 53 data.se lectPreviousImage();53 data.setSelectedImage(data.getPreviousImage()); 54 54 assertNull(data.getSelectedImage()); 55 55 assertFalse(data.hasNextImage()); … … 96 96 97 97 ImageData data = new ImageData(list); 98 data.se lectFirstImage();98 data.setSelectedImage(data.getFirstImage()); 99 99 assertEquals(1, data.getSelectedImages().size()); 100 100 assertEquals(list.get(0), data.getSelectedImages().get(0)); … … 107 107 108 108 ImageData data = new ImageData(list); 109 data.se lectLastImage();109 data.setSelectedImage(data.getLastImage()); 110 110 assertEquals(1, data.getSelectedImages().size()); 111 111 assertEquals(list.get(1), data.getSelectedImages().get(0)); … … 118 118 ImageData data = new ImageData(list); 119 119 assertTrue(data.hasNextImage()); 120 data.se lectNextImage();120 data.setSelectedImage(data.getNextImage()); 121 121 assertEquals(1, data.getSelectedImages().size()); 122 122 assertEquals(list.get(0), data.getSelectedImages().get(0)); 123 123 assertFalse(data.hasNextImage()); 124 data.se lectNextImage();125 assert Equals(list.get(0),data.getSelectedImages().get(0));124 data.setSelectedImage(data.getNextImage()); 125 assertTrue(data.getSelectedImages().isEmpty()); 126 126 } 127 127 … … 133 133 ImageData data = new ImageData(list); 134 134 assertFalse(data.hasPreviousImage()); 135 data.se lectLastImage();135 data.setSelectedImage(data.getLastImage()); 136 136 assertTrue(data.hasPreviousImage()); 137 data.se lectPreviousImage();138 assertEquals(1, data.getSelectedImages().size()); 139 assertEquals(list.get(0), data.getSelectedImages().get(0)); 140 data.se lectPreviousImage();141 assert Equals(list.get(0),data.getSelectedImages().get(0));137 data.setSelectedImage(data.getPreviousImage()); 138 assertEquals(1, data.getSelectedImages().size()); 139 assertEquals(list.get(0), data.getSelectedImages().get(0)); 140 data.setSelectedImage(data.getPreviousImage()); 141 assertTrue(data.getSelectedImages().isEmpty()); 142 142 } 143 143 … … 177 177 }}; 178 178 data.addImageDataUpdateListener(listener); 179 data.se lectFirstImage();180 data.se lectFirstImage();179 data.setSelectedImage(data.getFirstImage()); 180 data.setSelectedImage(data.getFirstImage()); 181 181 } 182 182 … … 187 187 188 188 ImageData data = new ImageData(list); 189 data.se lectFirstImage();189 data.setSelectedImage(data.getFirstImage()); 190 190 data.addImageToSelection(list.get(1)); 191 191 data.removeSelectedImages(); … … 199 199 list.add(new ImageEntry()); 200 200 list.add(new ImageEntry()); 201 202 ImageData data = new ImageData(list); 203 data.selectLastImage(); 201 // The images cannot be equal -- otherwise, some code gives us the wrong result. 202 list.get(1).setPos(LatLon.NORTH_POLE); 203 204 ImageData data = new ImageData(list); 205 data.setSelectedImage(data.getLastImage()); 204 206 data.addImageToSelection(list.get(1)); 205 207 data.removeSelectedImages(); … … 214 216 215 217 ImageData data = new ImageData(list); 216 data.se lectFirstImage();218 data.setSelectedImage(data.getFirstImage()); 217 219 data.removeSelectedImages(); 218 220 assertEquals(1, data.getImages().size()); … … 227 229 228 230 ImageData data = new ImageData(list); 229 data.se lectLastImage();231 data.setSelectedImage(data.getLastImage()); 230 232 data.removeSelectedImages(); 231 233 assertEquals(1, data.getImages().size()); … … 250 252 }}; 251 253 data.addImageDataUpdateListener(listener); 252 data.se lectFirstImage();254 data.setSelectedImage(data.getFirstImage()); 253 255 data.removeSelectedImages(); 254 256 } … … 270 272 }}; 271 273 data.addImageDataUpdateListener(listener); 272 data.se lectFirstImage();274 data.setSelectedImage(data.getFirstImage()); 273 275 data.removeSelectedImages(); 274 276 } … … 355 357 356 358 ImageData data = new ImageData(list); 357 data.se lectLastImage();359 data.setSelectedImage(data.getLastImage()); 358 360 data.removeImageToSelection(list.get(1)); 359 361 assertEquals(0, data.getSelectedImages().size()); 360 data.se lectFirstImage();362 data.setSelectedImage(data.getFirstImage()); 361 363 assertEquals(1, data.getSelectedImages().size()); 362 364 } … … 369 371 ImageData data = new ImageData(list); 370 372 assertFalse(data.isImageSelected(list.get(0))); 371 data.se lectFirstImage();373 data.setSelectedImage(data.getFirstImage()); 372 374 assertTrue(data.isImageSelected(list.get(0))); 373 375 data.addImageToSelection(list.get(1)); … … 394 396 assertEquals(0, data.getSelectedImages().size()); 395 397 data.addImageToSelection(list.get(1)); 396 data.se lectFirstImage();398 data.setSelectedImage(data.getFirstImage()); 397 399 assertEquals(1, data.getSelectedImages().size()); 398 400 } … … 414 416 }}; 415 417 data.addImageDataUpdateListener(listener); 416 data.se lectFirstImage();418 data.setSelectedImage(data.getFirstImage()); 417 419 data.addImageToSelection(list.get(1)); 418 420 data.removeImageToSelection(list.get(0));
Note:
See TracChangeset
for help on using the changeset viewer.