Changeset 10475 in josm for trunk/test/unit/org/openstreetmap/josm/io/NmeaReaderTest.java
- Timestamp:
- 2016-06-24T08:36:12+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/NmeaReaderTest.java
r10467 r10475 10 10 import java.util.TimeZone; 11 11 12 import org.junit.Rule; 12 13 import org.junit.Test; 13 14 import org.openstreetmap.josm.data.coor.LatLon; … … 15 16 import org.openstreetmap.josm.data.gpx.WayPoint; 16 17 import org.openstreetmap.josm.io.NmeaReader.NMEA_TYPE; 18 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 21 import nl.jqno.equalsverifier.EqualsVerifier; 19 22 … … 22 25 */ 23 26 public class NmeaReaderTest { 27 /** 28 * Set the timezone and timeout. 29 */ 30 @Rule 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 public JOSMTestRules test = new JOSMTestRules(); 24 33 25 34 /** … … 37 46 @Test 38 47 public void testReader() throws Exception { 48 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); 39 49 final NmeaReader in = new NmeaReader(new FileInputStream("data_nodist/btnmeatrack_2016-01-25.nmea")); 40 50 assertEquals(30, in.getNumberOfCoordinates()); 41 51 assertEquals(0, in.getParserMalformed()); 42 52 43 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin"));44 53 final List<WayPoint> wayPoints = new ArrayList<>(in.data.tracks.iterator().next().getSegments().iterator().next().getWayPoints()); 45 assertEquals("2016-01-25T0 4:05:09.200Z", wayPoints.get(0).get(GpxConstants.PT_TIME));46 assertEquals("2016-01-25T0 4:05:09.400Z", wayPoints.get(1).get(GpxConstants.PT_TIME));47 assertEquals("2016-01-25T0 4:05:09.600Z", wayPoints.get(2).get(GpxConstants.PT_TIME));54 assertEquals("2016-01-25T05:05:09.200Z", wayPoints.get(0).get(GpxConstants.PT_TIME)); 55 assertEquals("2016-01-25T05:05:09.400Z", wayPoints.get(1).get(GpxConstants.PT_TIME)); 56 assertEquals("2016-01-25T05:05:09.600Z", wayPoints.get(2).get(GpxConstants.PT_TIME)); 48 57 49 58 final SimpleDateFormat iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX"); 50 assertEquals("2016-01-25T0 5:05:09.200+01", iso8601.format(wayPoints.get(0).getTime()));51 assertEquals("2016-01-25T0 5:05:09.400+01", iso8601.format(wayPoints.get(1).getTime()));52 assertEquals("2016-01-25T0 5:05:09.600+01", iso8601.format(wayPoints.get(2).getTime()));59 assertEquals("2016-01-25T06:05:09.200+01", iso8601.format(wayPoints.get(0).getTime())); 60 assertEquals("2016-01-25T06:05:09.400+01", iso8601.format(wayPoints.get(1).getTime())); 61 assertEquals("2016-01-25T06:05:09.600+01", iso8601.format(wayPoints.get(2).getTime())); 53 62 54 63 assertEquals(new LatLon(46.98807, -1.400525), wayPoints.get(0).getCoor());
Note:
See TracChangeset
for help on using the changeset viewer.