Changeset 18870 in josm for trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
- Timestamp:
- 2023-10-16T15:19:07+02:00 (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
r18494 r18870 21 21 import org.junit.jupiter.api.BeforeEach; 22 22 import org.junit.jupiter.api.Test; 23 import org.junit.jupiter.api.extension.RegisterExtension;24 23 import org.openstreetmap.josm.TestUtils; 25 24 import org.openstreetmap.josm.data.Bounds; … … 32 31 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 33 32 import org.openstreetmap.josm.io.GpxReaderTest; 34 import org.openstreetmap.josm.testutils. JOSMTestRules;33 import org.openstreetmap.josm.testutils.annotations.Projection; 35 34 import org.openstreetmap.josm.tools.ListenerList; 36 35 import org.openstreetmap.josm.tools.date.Interval; 37 36 import org.xml.sax.SAXException; 38 37 39 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;40 38 import nl.jqno.equalsverifier.EqualsVerifier; 41 39 import nl.jqno.equalsverifier.Warning; … … 44 42 * Unit tests for class {@link GpxData}. 45 43 */ 44 @Projection 46 45 class GpxDataTest { 47 48 /**49 * Setup test.50 */51 @RegisterExtension52 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")53 public JOSMTestRules test = new JOSMTestRules().projection();54 55 46 private GpxData data; 56 47 … … 339 330 p2.setInstant(Instant.ofEpochMilli(200020)); 340 331 341 data.addTrack(new GpxTrack( Arrays.asList(Arrays.asList(p2)), Collections.emptyMap()));342 data.addTrack(new GpxTrack( Arrays.asList(Arrays.asList(p1)), Collections.emptyMap()));332 data.addTrack(new GpxTrack(Collections.singletonList(Collections.singletonList(p2)), Collections.emptyMap())); 333 data.addTrack(new GpxTrack(Collections.singletonList(Collections.singletonList(p1)), Collections.emptyMap())); 343 334 344 335 List<IGpxTrack> tracks = data.getOrderedTracks(); … … 364 355 p2.setInstant(Instant.ofEpochMilli(100020)); 365 356 p4.setInstant(Instant.ofEpochMilli(500020)); 366 data.addTrack(new GpxTrack( Arrays.asList(Arrays.asList(p1, p2)), Collections.emptyMap()));367 data.addTrack(new GpxTrack( Arrays.asList(Arrays.asList(p3, p4, p5)), Collections.emptyMap()));357 data.addTrack(new GpxTrack(Collections.singletonList(Arrays.asList(p1, p2)), Collections.emptyMap())); 358 data.addTrack(new GpxTrack(Collections.singletonList(Arrays.asList(p3, p4, p5)), Collections.emptyMap())); 368 359 369 360 Interval times = data.getMinMaxTimeForAllTracks().orElse(null); … … 383 374 .map(WayPoint::new) 384 375 .collect(Collectors.toList()); 385 data.addTrack(new GpxTrack( Arrays.asList(points), Collections.emptyMap()));376 data.addTrack(new GpxTrack(Collections.singletonList(points), Collections.emptyMap())); 386 377 387 378 WayPoint closeToMiddle = data.nearestPointOnTrack(new EastNorth(10, 0), 10); … … 406 397 DataSource ds = new DataSource(new Bounds(0, 0, 1, 1), "test"); 407 398 data.dataSources.add(ds); 408 assertEquals(new ArrayList<>( Arrays.asList(ds)), new ArrayList<>(data.getDataSources()));399 assertEquals(new ArrayList<>(Collections.singletonList(ds)), new ArrayList<>(data.getDataSources())); 409 400 } 410 401 … … 429 420 DataSource ds = new DataSource(bounds, "test"); 430 421 data.dataSources.add(ds); 431 assertEquals( Arrays.asList(bounds), data.getDataSourceBounds());422 assertEquals(Collections.singletonList(bounds), data.getDataSourceBounds()); 432 423 } 433 424
Note:
See TracChangeset
for help on using the changeset viewer.