Changeset 9394 in josm for trunk/test
- Timestamp:
- 2016-01-10T18:06:13+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
r9384 r9394 13 13 import org.openstreetmap.josm.io.GpxReaderTest; 14 14 import org.openstreetmap.josm.tools.date.DateUtils; 15 import org.openstreetmap.josm.tools.date.DateUtilsTest; 15 16 16 17 /** … … 24 25 @BeforeClass 25 26 public static void setUp() { 26 TimeZone.setDefault(TimeZone.getTimeZone("UTC"));27 DateUtilsTest.setTimeZone(TimeZone.getTimeZone("UTC")); 27 28 } 28 29 -
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r8509 r9394 11 11 import java.util.Date; 12 12 import java.util.GregorianCalendar; 13 import java.util.TimeZone; 13 14 14 15 import org.junit.Before; 15 16 import org.junit.Test; 16 17 import org.openstreetmap.josm.data.coor.LatLon; 18 import org.openstreetmap.josm.tools.date.DateUtilsTest; 17 19 18 20 /** … … 31 33 directionSampleFile = new File("data_nodist/exif-example_direction.jpg"); 32 34 orientationSampleFile = new File("data_nodist/exif-example_orientation=6.jpg"); 35 DateUtilsTest.setTimeZone(TimeZone.getTimeZone("Europe/Berlin")); 33 36 } 34 37 -
trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
r9385 r9394 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import java.util.Date;7 6 import java.util.TimeZone; 8 7 … … 17 16 18 17 /** 19 * Setup test. 18 * Allows to override the timezone used in {@link DateUtils} for unit tests. 19 * @param zone the timezone to use 20 20 */ 21 @BeforeClass 22 public static void setUp() { 23 TimeZone.setDefault(TimeZone.getTimeZone("GMT+8:00")); 21 public static void setTimeZone(TimeZone zone) { 22 DateUtils.setTimeZone(zone); 24 23 } 25 24 … … 45 44 @Test 46 45 public void testExifDate() { 46 setTimeZone(TimeZone.getTimeZone("GMT+8:00")); // parsing is timezone aware 47 47 assertEquals(1443038712000L - 8 * 3600 * 1000, DateUtils.fromString("2015:09:23 20:05:12").getTime()); 48 48 assertEquals(1443038712888L - 8 * 3600 * 1000, DateUtils.fromString("2015:09:23 20:05:12.888").getTime());
Note:
See TracChangeset
for help on using the changeset viewer.