Changeset 15343 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-09-09T23:22:13+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java
r15250 r15343 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import java.io.IOException; 6 7 import java.nio.file.Files; 7 8 import java.nio.file.Paths; … … 19 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 20 21 import org.openstreetmap.josm.tools.date.DateUtils; 22 import org.xml.sax.SAXException; 21 23 22 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 43 45 } 44 46 47 private static RtkLibPosReader read(String path) throws IOException, SAXException { 48 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); 49 RtkLibPosReader in = new RtkLibPosReader(Files.newInputStream(Paths.get(path))); 50 in.parse(true); 51 return in; 52 } 53 45 54 /** 46 55 * Tests reading a RTKLib pos file. … … 49 58 @Test 50 59 public void testReader() throws Exception { 51 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); 52 RtkLibPosReader in = new RtkLibPosReader(Files.newInputStream(Paths.get("data_nodist/rtklib_example.pos"))); 53 in.parse(true); 60 RtkLibPosReader in = read("data_nodist/rtklib_example.pos"); 54 61 assertEquals(137, in.getNumberOfCoordinates()); 55 62 … … 70 77 assertEquals("2.2090015", wayPoints.get(0).get(GpxConstants.PT_HDOP).toString().trim()); 71 78 } 79 80 /** 81 * Tests reading another RTKLib pos file with different date format. 82 * @throws Exception if any error occurs 83 */ 84 @Test 85 public void testReader2() throws Exception { 86 RtkLibPosReader in = read("data_nodist/rtklib_example2.pos"); 87 assertEquals(6, in.getNumberOfCoordinates()); 88 } 72 89 }
Note:
See TracChangeset
for help on using the changeset viewer.