Changeset 9394 in josm for trunk/test/unit/org/openstreetmap/josm/tools/date
- Timestamp:
- 2016-01-10T18:06:13+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.