Changeset 14446 in josm for trunk/test


Ignore:
Timestamp:
2018-11-24T15:00:43+01:00 (12 months ago)
Author:
Don-vip
Message:

see #16995 - use_Date exclusively for PT_TIME attribute (patch by cmuelle8)

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java

    r14349 r14446  
    221221                "    <tag k='time' v='2018-08-01T10:01:00Z' />\n" +
    222222                "  </node>\n" +
    223                 "  <way id='-546308'>\n" +
     223                "  <node id='-546308' timestamp='2018-08-01T10:02:00Z' lat='47.05' lon='9.05'>\n" +
     224                "    <tag k='ele' v='789' />\n" +
     225                "  </node>\n" +
     226                "  <way id='-546309'>\n" +
    224227                "    <nd ref='-546306' />\n" +
    225228                "    <nd ref='-546307' />\n" +
     229                "    <nd ref='-546308' />\n" +
    226230                "  </way>\r\n" +
    227231                "</osm>").getBytes(StandardCharsets.UTF_8)), null));
     
    238242        assertEquals(1, segments.size());
    239243        Collection<WayPoint> trackpoints = segments.iterator().next().getWayPoints();
    240         assertEquals(2, trackpoints.size());
     244        assertEquals(3, trackpoints.size());
    241245        Iterator<WayPoint> it = trackpoints.iterator();
    242246        DateFormat gpxFormat = DateUtils.getGpxFormat();
     
    249253        assertEquals("456", p2.get(GpxConstants.PT_ELE));
    250254        assertEquals("2018-08-01T10:01:00.000Z", gpxFormat.format(p2.get(GpxConstants.PT_TIME)));
     255        WayPoint p3 = it.next();
     256        assertEquals(new LatLon(47.05, 9.05), p3.getCoor());
     257        assertEquals("789", p3.get(GpxConstants.PT_ELE));
     258        assertEquals("2018-08-01T10:02:00.000Z", gpxFormat.format(p3.get(GpxConstants.PT_TIME)));
    251259    }
    252260
  • trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java

    r14083 r14446  
    6767
    6868        final List<WayPoint> wayPoints = new ArrayList<>(in.data.tracks.iterator().next().getSegments().iterator().next().getWayPoints());
    69         assertEquals("2016-01-25T05:05:09.2Z", wayPoints.get(0).get(GpxConstants.PT_TIME));
    70         assertEquals("2016-01-25T05:05:09.4Z", wayPoints.get(1).get(GpxConstants.PT_TIME));
    71         assertEquals("2016-01-25T05:05:09.6Z", wayPoints.get(2).get(GpxConstants.PT_TIME));
    72         assertEquals(wayPoints.get(0).getTime(), DateUtils.fromString(wayPoints.get(0).get(GpxConstants.PT_TIME).toString()));
     69        assertEquals(DateUtils.fromString("2016-01-25T05:05:09.200Z"), wayPoints.get(0).get(GpxConstants.PT_TIME));
     70        assertEquals(DateUtils.fromString("2016-01-25T05:05:09.400Z"), wayPoints.get(1).get(GpxConstants.PT_TIME));
     71        assertEquals(DateUtils.fromString("2016-01-25T05:05:09.600Z"), wayPoints.get(2).get(GpxConstants.PT_TIME));
     72        assertEquals(wayPoints.get(0).getTime(), wayPoints.get(0).get(GpxConstants.PT_TIME));
    7373
    7474        assertEquals("2016-01-25T05:05:09.200Z", iso8601.format(wayPoints.get(0).getTime()));
Note: See TracChangeset for help on using the changeset viewer.