Changeset 17712 in josm for trunk/test/unit/org/openstreetmap/josm/tools
- Timestamp:
- 2021-04-07T22:34:03+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
r17275 r17712 10 10 11 11 import java.text.DateFormat; 12 import java.time.Instant; 13 import java.time.format.FormatStyle; 12 14 import java.util.Date; 13 15 import java.util.Random; … … 272 274 assertNotSame(date, DateUtils.cloneDate(date)); 273 275 } 276 277 /** 278 * Unit test of {@link DateUtils#getDateTimeFormatter} method. 279 */ 280 @Test 281 void testDateTimeFormatter() { 282 Instant instant = Instant.parse("2006-01-02T15:04:05Z"); 283 Boolean iso = DateUtils.PROP_ISO_DATES.get(); 284 try { 285 assertNotNull(DateUtils.getDateFormatter(FormatStyle.SHORT).format(instant)); 286 assertNotNull(DateUtils.getTimeFormatter(FormatStyle.SHORT).format(instant)); 287 assertNotNull(DateUtils.getDateTimeFormatter(FormatStyle.SHORT, FormatStyle.SHORT).format(instant)); 288 DateUtils.PROP_ISO_DATES.put(!iso); 289 assertNotNull(DateUtils.getDateFormatter(FormatStyle.SHORT).format(instant)); 290 assertNotNull(DateUtils.getTimeFormatter(FormatStyle.SHORT).format(instant)); 291 assertNotNull(DateUtils.getDateTimeFormatter(FormatStyle.SHORT, FormatStyle.SHORT).format(instant)); 292 } finally { 293 DateUtils.PROP_ISO_DATES.put(iso); 294 } 295 } 274 296 }
Note:
See TracChangeset
for help on using the changeset viewer.