Changeset 12156 in josm for trunk/test


Ignore:
Timestamp:
2017-05-15T14:14:40+02:00 (8 years ago)
Author:
michael2402
Message:

See #14120: Don't make gpx tracks depend on the isChanged method, use a listener based approach instead.

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

Legend:

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

    r11713 r12156  
    66import java.io.FileNotFoundException;
    77import java.io.IOException;
    8 import java.util.ArrayList;
    9 import java.util.Iterator;
    108import java.util.List;
     9import java.util.stream.Collectors;
    1110
    1211import org.junit.BeforeClass;
     
    1615import org.openstreetmap.josm.TestUtils;
    1716import org.openstreetmap.josm.data.gpx.GpxData;
    18 import org.openstreetmap.josm.data.gpx.WayPoint;
    1917import org.openstreetmap.josm.io.GpxReaderTest;
    2018import org.openstreetmap.josm.tools.ColorHelper;
     
    128126        gdh.readPreferences(layerName);
    129127        gdh.calculateColors();
    130         final Iterator<WayPoint> wayPointIterator = data.tracks.iterator().next().getSegments().iterator().next().getWayPoints().iterator();
    131         final List<String> colorCodes = new ArrayList<>(n);
    132         while (colorCodes.size() < n) {
    133             colorCodes.add(ColorHelper.color2html(wayPointIterator.next().customColoring));
    134         }
    135         return colorCodes;
     128        return data.getTrackPoints().limit(n).map(p -> ColorHelper.color2html(p.customColoring)).collect(Collectors.toList());
    136129    }
    137130}
  • trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java

    r10733 r12156  
    4747    public void testMunich() throws Exception {
    4848        final GpxData result = parseGpxData("data_nodist/munich.gpx");
    49         assertEquals(2762, result.tracks.size());
    50         assertEquals(0, result.routes.size());
    51         assertEquals(903, result.waypoints.size());
     49        assertEquals(2762, result.getTracks().size());
     50        assertEquals(0, result.getRoutes().size());
     51        assertEquals(903, result.getWaypoints().size());
    5252
    5353        final WayPoint tenthWayPoint = ((List<WayPoint>) result.waypoints).get(10);
Note: See TracChangeset for help on using the changeset viewer.