Changeset 14266 in josm for trunk/test


Ignore:
Timestamp:
2018-09-21T21:53:17+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #16762 - support multiple notes in .osc files created by OsmAnd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java

    r14101 r14266  
    88import java.nio.charset.StandardCharsets;
    99import java.util.Collection;
     10import java.util.Iterator;
    1011
    1112import org.junit.Rule;
     
    5960                "      <comment text=\"something\" />\r\n" +
    6061                "    </note>\r\n" +
     62                "    <note lat=\"50.5\" lon=\"13.5\" id=\"-3\">\r\n" +
     63                "      <comment text=\"something else\" />\r\n" +
     64                "    </note>\r\n" +
    6165                "  </create>\r\n" +
    6266                "  <modify />\r\n" +
    6367                "  <delete />").b;
    64         Collection<Note> notes = nd.getNotes();
    65         assertEquals(1, notes.size());
    66         Note n = notes.iterator().next();
     68        Collection<Note> notes = nd.getSortedNotes();
     69        assertEquals(2, notes.size());
     70        Iterator<Note> iterator = notes.iterator();
     71        Note n = iterator.next();
    6772        assertEquals(new LatLon(50.23887555404037, 13.358299552342795), n.getLatLon());
    6873        assertEquals("something", n.getFirstComment().getText());
     74        n = iterator.next();
     75        assertEquals(new LatLon(50.5, 13.5), n.getLatLon());
     76        assertEquals("something else", n.getFirstComment().getText());
    6977    }
    7078}
Note: See TracChangeset for help on using the changeset viewer.