Changeset 17310 in josm for trunk/test/unit
- Timestamp:
- 2020-11-14T16:31:36+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/ImageDataTest.java
r17275 r17310 9 9 import java.io.File; 10 10 import java.util.ArrayList; 11 import java.util.Arrays; 11 12 import java.util.Collections; 13 import java.util.Date; 12 14 import java.util.List; 13 15 … … 20 22 import mockit.Mock; 21 23 import mockit.MockUp; 22 import mockit.Mocked;23 import mockit.Verifications;24 24 25 25 /** … … 28 28 class ImageDataTest { 29 29 30 private static ImageEntry newImageEntry(String file, Date exifTime) { 31 ImageEntry entry = new ImageEntry(new File(file)); 32 entry.setExifTime(exifTime); 33 return entry; 34 } 35 30 36 private static List<ImageEntry> getOneImage() { 31 37 ArrayList<ImageEntry> list = new ArrayList<>(); 32 list.add(new ImageEntry(new File("test")));38 list.add(newImageEntry("test", null)); 33 39 return list; 34 40 } … … 58 64 59 65 @Test 60 void testSortData(@Mocked Collections ignore) { 61 List<ImageEntry> list = getOneImage(); 62 63 new ImageData(list); 64 65 new Verifications() {{ 66 Collections.sort(list); 67 }}; 66 void testSortData() { 67 ImageEntry entry1 = newImageEntry("test1", new Date(1_000_000)); 68 ImageEntry entry2 = newImageEntry("test2", new Date(2_000_000)); 69 70 ArrayList<ImageEntry> list = new ArrayList<>(); 71 list.add(entry2); 72 list.add(entry1); 73 74 assertEquals(Arrays.asList(entry1, entry2), new ImageData(list).getImages()); 68 75 } 69 76
Note:
See TracChangeset
for help on using the changeset viewer.