Changeset 1951 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2009-08-10T20:36:40+02:00 (12 years ago)
Author:
jttt
Message:

Replace some occurrences of RelationMember.member with getters

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

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java

    r1926 r1951  
    153153        Relation r1 = new Relation(1);
    154154        Node n20 = new Node(20);
    155         r1.members.add(new RelationMember("node-20",n20));
     155        r1.addMember(new RelationMember("node-20",n20));
    156156        Way w30 = new Way(30);
    157157        Node n21;
     
    159159        Node n22;
    160160        w30.addNode(n22 = new Node(22));
    161         r1.members.add(new RelationMember("way-30",w30));
     161        r1.addMember(new RelationMember("way-30",w30));
    162162        Relation r40 = new Relation(40);
    163         r1.members.add(new RelationMember("relation-40", r40));
     163        r1.addMember(new RelationMember("relation-40", r40));
    164164        source.nodes.add(n20);
    165165        source.nodes.add(n21);
     
    199199        assertEquals(3, r.getMembersCount());
    200200        RelationMember m = new RelationMember("node-20", hull.getPrimitiveById(20));
    201         assertTrue(r.members.contains(m));
     201        assertTrue(r.getMembers().contains(m));
    202202        m = new RelationMember("way-30", hull.getPrimitiveById(30));
    203         assertTrue(r.members.contains(m));
     203        assertTrue(r.getMembers().contains(m));
    204204        m = new RelationMember("relation-40", hull.getPrimitiveById(40));
    205         assertTrue(r.members.contains(m));
     205        assertTrue(r.getMembers().contains(m));
    206206    }
    207207
     
    211211        Relation r1 = new Relation(1);
    212212        Node n20 = new Node(20);
    213         r1.members.add(new RelationMember("node-20",n20));
     213        r1.addMember(new RelationMember("node-20",n20));
    214214        Way w30 = new Way(30);
    215215        Node n21;
     
    217217        Node n22;
    218218        w30.addNode(n22 = new Node(22));
    219         r1.members.add(new RelationMember("way-30",w30));
     219        r1.addMember(new RelationMember("way-30",w30));
    220220        Relation r40 = new Relation(40);
    221         r1.members.add(new RelationMember("relation-40", r40));
     221        r1.addMember(new RelationMember("relation-40", r40));
    222222        source.nodes.add(n20);
    223223        source.nodes.add(n21);
     
    258258        assertEquals(3, r.getMembersCount());
    259259        RelationMember m = new RelationMember("node-20", hull.getPrimitiveById(20));
    260         assertTrue(r.members.contains(m));
     260        assertTrue(r.getMembers().contains(m));
    261261        m = new RelationMember("way-30", hull.getPrimitiveById(30));
    262         assertTrue(r.members.contains(m));
     262        assertTrue(r.getMembers().contains(m));
    263263        m = new RelationMember("relation-40", hull.getPrimitiveById(40));
    264         assertTrue(r.members.contains(m));
     264        assertTrue(r.getMembers().contains(m));
    265265    }
    266266
     
    272272        Node n20 = new Node(new LatLon(20.0,20.0));
    273273        n20.put("name", "n20");
    274         r1.members.add(new RelationMember("node-20",n20));
     274        r1.getMembers().add(new RelationMember("node-20",n20));
    275275        Way w30 = new Way();
    276276        w30.put("name", "w30");
     
    281281        w30.addNode(n22 = new Node(new LatLon(22.0,22.0)));
    282282        n22.put("name","n22");
    283         r1.members.add(new RelationMember("way-30",w30));
     283        r1.addMember(new RelationMember("way-30",w30));
    284284        Relation r40 = new Relation();
    285285        r40.put("name", "r40");
    286         r1.members.add(new RelationMember("relation-40", r40));
     286        r1.addMember(new RelationMember("relation-40", r40));
    287287        source.nodes.add(n20);
    288288        source.nodes.add(n21);
     
    323323        assertEquals(3, r.getMembersCount());
    324324        RelationMember m = new RelationMember("node-20", lookupByName(hull.nodes, "n20"));
    325         assertTrue(r.members.contains(m));
     325        assertTrue(r.getMembers().contains(m));
    326326        m = new RelationMember("way-30", lookupByName(hull.ways, "w30"));
    327         assertTrue(r.members.contains(m));
     327        assertTrue(r.getMembers().contains(m));
    328328        m = new RelationMember("relation-40", lookupByName(hull.relations, "r40"));
    329         assertTrue(r.members.contains(m));
     329        assertTrue(r.getMembers().contains(m));
    330330    }
    331331
     
    334334        DataSet source = new DataSet();
    335335        Relation r1 = new Relation(1);
    336         r1.members.add(new RelationMember("relation-1",r1));
     336        r1.addMember(new RelationMember("relation-1",r1));
    337337        source.relations.add(r1);
    338338        source.setSelected(r1);
     
    346346        assertNotNull(r);
    347347        assertEquals(1, r.getMembersCount());
    348         assertTrue(r.members.contains(new RelationMember("relation-1",r)));
     348        assertTrue(r.getMembers().contains(new RelationMember("relation-1",r)));
    349349    }
    350350
     
    354354        Relation r1 = new Relation();
    355355        r1.put("name", "r1");
    356         r1.members.add(new RelationMember("relation-1",r1));
     356        r1.addMember(new RelationMember("relation-1",r1));
    357357        source.relations.add(r1);
    358358        source.setSelected(r1);
     
    366366        assertNotNull(r);
    367367        assertEquals(1, r.getMembersCount());
    368         assertTrue(r.members.contains(new RelationMember("relation-1",r)));
     368        assertTrue(r.getMembers().contains(new RelationMember("relation-1",r)));
    369369    }
    370370
     
    374374        Relation r1 = new Relation(1);
    375375        Relation r2 = new Relation(2);
    376         r1.members.add(new RelationMember("relation-2",r2));
    377         r2.members.add(new RelationMember("relation-1",r1));
     376        r1.addMember(new RelationMember("relation-2",r2));
     377        r2.addMember(new RelationMember("relation-1",r1));
    378378        source.relations.add(r1);
    379379        source.relations.add(r2);
     
    390390        assertNotNull(r2);
    391391        assertEquals(1, r1.getMembersCount());
    392         assertTrue(r1.members.contains(new RelationMember("relation-2",r2)));
     392        assertTrue(r1.getMembers().contains(new RelationMember("relation-2",r2)));
    393393        assertEquals(1, r2.getMembersCount());
    394         assertTrue(r2.members.contains(new RelationMember("relation-1",r1)));
     394        assertTrue(r2.getMembers().contains(new RelationMember("relation-1",r1)));
    395395    }
    396396}
  • trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java

    r1948 r1951  
    965965        theirRelation.id = 4;
    966966        theirRelation.version = 1;
    967         theirRelation.members.add(new RelationMember("", n3));
    968         theirRelation.members.add(new RelationMember("", n4));
    969         theirRelation.members.add(new RelationMember("", n5));
     967        theirRelation.addMember(new RelationMember("", n3));
     968        theirRelation.addMember(new RelationMember("", n4));
     969        theirRelation.addMember(new RelationMember("", n5));
    970970        their.addPrimitive(theirRelation);
    971971
Note: See TracChangeset for help on using the changeset viewer.