Changeset 3107 in josm for trunk/test


Ignore:
Timestamp:
2010-03-10T19:11:58+01:00 (10 years ago)
Author:
jttt
Message:

Fix #4624 Relations not rendered right away

File:
1 edited

Legend:

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

    r2982 r3107  
    6565    }
    6666
     67    @Test
     68    public void testBBoxNotInDataset() {
     69        Node n1 = new Node(new LatLon(10, 10));
     70        Node n2 = new Node(new LatLon(20, 20));
     71        Way w1 = new Way();
     72        w1.addNode(n1);
     73        w1.addNode(n2);
     74        Relation r1 = new Relation();
     75        r1.getBBox();
     76        r1.addMember(new RelationMember("", w1));
     77
     78        Assert.assertEquals(new BBox(w1), r1.getBBox());
     79
     80        DataSet ds = new DataSet();
     81        ds.addPrimitive(n1);
     82        ds.addPrimitive(n2);
     83        ds.addPrimitive(w1);
     84        ds.addPrimitive(r1);
     85
     86        Assert.assertEquals(new BBox(w1), r1.getBBox());
     87
     88        ds.removePrimitive(r1);
     89
     90        n1.setCoor(new LatLon(30, 40));
     91        Assert.assertEquals(new BBox(w1), r1.getBBox());
     92
     93        ds.addPrimitive(r1);
     94        Assert.assertEquals(new BBox(w1), r1.getBBox());
     95    }
     96
    6797}
Note: See TracChangeset for help on using the changeset viewer.