Changeset 17845 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2021-05-01T14:00:25+02:00 (4 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
r17841 r17845 33 33 import org.openstreetmap.josm.testutils.JOSMTestRules; 34 34 import org.openstreetmap.josm.tools.ListenerList; 35 import org.openstreetmap.josm.tools.date.Interval; 35 36 import org.xml.sax.SAXException; 36 37 … … 330 331 @Test 331 332 void testGetMinMaxTimeForAllTracks() { 332 assert Equals(0, data.getMinMaxTimeForAllTracks().length);333 assertFalse(data.getMinMaxTimeForAllTracks().isPresent()); 333 334 334 335 WayPoint p1 = new WayPoint(LatLon.NORTH_POLE); … … 343 344 data.addTrack(new GpxTrack(Arrays.asList(Arrays.asList(p3, p4, p5)), Collections.emptyMap())); 344 345 345 In stant[] times = data.getMinMaxTimeForAllTracks();346 assertEquals( times.length, 2);347 assertEquals(Instant.ofEpochMilli(100020), times [0]);348 assertEquals(Instant.ofEpochMilli(500020), times [1]);346 Interval times = data.getMinMaxTimeForAllTracks().orElse(null); 347 assertEquals("1970-01-01T00:01:40.020Z/1970-01-01T00:08:20.020Z", times.toString()); 348 assertEquals(Instant.ofEpochMilli(100020), times.getStart()); 349 assertEquals(Instant.ofEpochMilli(500020), times.getEnd()); 349 350 } 350 351 -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r17844 r17845 10 10 import java.awt.Color; 11 11 import java.io.IOException; 12 import java.time.Instant;13 12 import java.util.ArrayList; 14 13 import java.util.Collection; … … 217 216 218 217 /** 219 * Unit test of {@link GpxLayer#formatTimespan}.220 */221 @Test222 void testFormatTimespan() {223 Instant[] timespan = {Instant.parse("2021-03-01T17:53:16Z"), Instant.parse("2021-04-03T08:19:19Z")};224 assertEquals("2021-03-01 17:53:16 \u2013 2021-04-03 08:19:19 (32 days 14 h)", GpxLayer.formatTimespan(timespan));225 }226 227 /**228 218 * Unit test of {@link GpxLayer#mergeFrom}. 229 219 * @throws Exception if any error occurs
Note:
See TracChangeset
for help on using the changeset viewer.