Changeset 2399 in josm for trunk/test/functional


Ignore:
Timestamp:
2009-11-07T14:41:34+01:00 (15 years ago)
Author:
jttt
Message:

Added map of primitives to dataset to make search by id faster
check if primitive already exist in addPrimitive and removePrimitive
use PrimitiveId instead of id + primitive type

Location:
trunk/test/functional/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r2396 r2399  
    247247        assertEquals(10, out.getNodes().size());
    248248        for (Node n1:out.getNodes()) {
    249             Node n2 = (Node)ds.getPrimitiveById(n1.getId(), OsmPrimitiveType.NODE);
     249            Node n2 = (Node)ds.getPrimitiveById(n1);
    250250            assertNotNull(n2);
    251251            assertEquals(n2.get("name"),n2.get("name"));
     
    264264        assertEquals(10, out.getWays().size());
    265265        for (Way w1: out.getWays()) {
    266             Way w2 = (Way)ds.getPrimitiveById(w1.getId(), OsmPrimitiveType.WAY);
     266            Way w2 = (Way)ds.getPrimitiveById(w1);
    267267            assertNotNull(w2);
    268268            assertEquals(w2.getNodesCount(), w1.getNodesCount());
     
    300300        assertEquals(812, out.getNodes().size());
    301301        for (Node n1:out.getNodes()) {
    302             Node n2 = (Node)ds.getPrimitiveById(n1.getId(), OsmPrimitiveType.NODE);
     302            Node n2 = (Node)ds.getPrimitiveById(n1);
    303303            assertNotNull(n2);
    304304            assertEquals(n2.get("name"),n2.get("name"));
     
    319319        assertEquals(10, out.getNodes().size());
    320320        for (Node n1:out.getNodes()) {
    321             Node n2 = (Node)ds.getPrimitiveById(n1.getId(), OsmPrimitiveType.NODE);
     321            Node n2 = (Node)ds.getPrimitiveById(n1);
    322322            assertNotNull(n2);
    323323            assertEquals(n2.get("name"),n2.get("name"));
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r2396 r2399  
    322322        Set<Long> expectedNodeIds = new HashSet<Long>();
    323323        for (Way way : referers.getWays()) {
    324             Way orig = (Way) ds.getPrimitiveById(way.getId(), OsmPrimitiveType.WAY);
     324            Way orig = (Way) ds.getPrimitiveById(way);
    325325            for (Node n : orig.getNodes()) {
    326326                expectedNodeIds.add(n.getId());
Note: See TracChangeset for help on using the changeset viewer.