Changeset 11514 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2017-01-30T23:21:38+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r11484 r11514 24 24 25 25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 26 26 27 /** 27 28 * EXIF metadata extraction test … … 70 71 public void testReadTimeSubSecond1() throws ParseException { 71 72 Date date = ExifReader.readTime(new File("data_nodist/IMG_20150711_193419.jpg")); 72 String dateStr = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(date); 73 assertEquals("2015-07-11T19:34:19.100", dateStr); 73 doTest("2015-07-11T19:34:19.100", date); 74 74 75 75 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); 76 76 date = ExifReader.readTime(new File("data_nodist/IMG_20150711_193419.jpg")); 77 77 TimeZone.setDefault(DateUtils.UTC); 78 dateStr = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(date); 79 assertEquals("2015-07-11T17:34:19.100", dateStr); 78 doTest("2015-07-11T17:34:19.100", date); 79 } 80 81 private static void doTest(String expectedDate, Date parsedDate) { 82 assertEquals(expectedDate, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(parsedDate)); 83 } 84 85 private static void doTestFile(String expectedDate, int ticket, String filename) { 86 doTest(expectedDate, ExifReader.readTime(new File(TestUtils.getRegressionDataFile(ticket, filename)))); 80 87 } 81 88 … … 115 122 @Test 116 123 public void testTicket11685() throws IOException { 117 File file = new File(TestUtils.getRegressionDataFile(11685, "2015-11-08_15-33-27-Xiaomi_YI-Y0030832.jpg")); 118 String dateStr = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(ExifReader.readTime(file)); 119 assertEquals("2015-11-08T15:33:27.500", dateStr); 124 doTestFile("2015-11-08T15:33:27.500", 11685, "2015-11-08_15-33-27-Xiaomi_YI-Y0030832.jpg"); 120 125 } 121 126 … … 126 131 @Test 127 132 public void testTicket14209() throws IOException { 128 File file = new File(TestUtils.getRegressionDataFile(14209, "0MbEfj1S--.1.jpg")); 129 String dateStr = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(ExifReader.readTime(file)); 130 assertEquals("2017-01-16T18:27:00.000", dateStr); 133 doTestFile("2017-01-16T18:27:00.000", 14209, "0MbEfj1S--.1.jpg"); 134 doTestFile("2016-08-13T19:51:13.000", 14209, "7VWFOryj--.1.jpg"); 131 135 } 132 136 }
Note:
See TracChangeset
for help on using the changeset viewer.