Changeset 15047 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-05-04T19:36:04+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r12746 r15047 10 10 import java.text.ParseException; 11 11 import java.text.SimpleDateFormat; 12 import java.time.ZoneId;13 12 import java.time.ZonedDateTime; 14 13 import java.util.Date; 15 import java.util.TimeZone;16 14 17 15 import org.junit.Before; … … 20 18 import org.openstreetmap.josm.TestUtils; 21 19 import org.openstreetmap.josm.data.coor.LatLon; 20 import org.openstreetmap.josm.data.coor.conversion.AbstractCoordinateFormat; 21 import org.openstreetmap.josm.data.coor.conversion.DMSCoordinateFormat; 22 22 import org.openstreetmap.josm.testutils.JOSMTestRules; 23 23 import org.openstreetmap.josm.tools.date.DateUtils; 24 24 25 25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 26 import org.openstreetmap.josm.data.coor.conversion.DMSCoordinateFormat;27 26 28 27 /** … … 56 55 public void testReadTime() throws ParseException { 57 56 Date date = ExifReader.readTime(directionSampleFile); 58 assertEquals(ZonedDateTime.of(2010, 5, 15, 17, 12, 5, 0, ZoneId.systemDefault()).toInstant(), date.toInstant()); 59 60 final TimeZone zone = TimeZone.getTimeZone("Europe/Berlin"); 61 TimeZone.setDefault(zone); 62 date = ExifReader.readTime(directionSampleFile); 63 TimeZone.setDefault(DateUtils.UTC); 64 assertEquals(ZonedDateTime.of(2010, 5, 15, 17, 12, 5, 0, zone.toZoneId()).toInstant(), date.toInstant()); 57 assertEquals(ZonedDateTime.of(2010, 5, 15, 17, 12, 5, 0, DateUtils.UTC.toZoneId()).toInstant(), date.toInstant()); 65 58 } 66 59 … … 73 66 Date date = ExifReader.readTime(new File("data_nodist/IMG_20150711_193419.jpg")); 74 67 doTest("2015-07-11T19:34:19.100", date); 75 76 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin"));77 date = ExifReader.readTime(new File("data_nodist/IMG_20150711_193419.jpg"));78 TimeZone.setDefault(DateUtils.UTC);79 doTest("2015-07-11T17:34:19.100", date);80 68 } 81 69 … … 104 92 LatLon latlon = ExifReader.readLatLon(directionSampleFile); 105 93 assertNotNull(latlon); 106 DecimalFormat f = newDecimalFormat("00.0");94 DecimalFormat f = AbstractCoordinateFormat.newUnlocalizedDecimalFormat("00.0"); 107 95 assertEquals("51°46'"+f.format(43.0)+"\"", DMSCoordinateFormat.degreesMinutesSeconds(latlon.lat())); 108 96 assertEquals("8°21'"+f.format(56.3)+"\"", DMSCoordinateFormat.degreesMinutesSeconds(latlon.lon()));
Note:
See TracChangeset
for help on using the changeset viewer.