Ignore:
Timestamp:
2016-09-20T22:46:47+02:00 (3 years ago)
Author:
simon04
Message:

see #13376 - Replace Calendar usages with Java 8 Date API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/ChangesetQueryUrlParserTest.groovy

    r10222 r11035  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.io;
    3 
    4 import static org.junit.Assert.*
     2package org.openstreetmap.josm.io
    53
    64import org.junit.Test
     
    86import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlParser
    97
     8import java.time.OffsetDateTime
     9import java.time.ZoneOffset
     10
    1011class ChangesetQueryUrlParserTest {
    1112    final shouldFail = new GroovyTestCase().&shouldFail
     
    127128        assert q != null
    128129        assert q.@closedAfter != null
    129         Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT+0"));
    130         cal.setTime(q.@closedAfter);
    131         assert cal.get(Calendar.YEAR) == 2009
    132         assert cal.get(Calendar.MONTH) == 11 // calendar is 0-based
    133         assert cal.get(Calendar.DAY_OF_MONTH) == 25
    134         assert cal.get(Calendar.HOUR_OF_DAY) == 10
    135         assert cal.get(Calendar.MINUTE) == 0
    136         assert cal.get(Calendar.SECOND) == 0
     130        def cal = q.@closedAfter.toInstant().atOffset(ZoneOffset.UTC)
     131        assert cal == OffsetDateTime.of(2009, 12, 25, 10, 0, 0, 0, ZoneOffset.UTC)
    137132
    138133        // OK
Note: See TracChangeset for help on using the changeset viewer.