Last change
on this file since 3153 was 3153, checked in by jttt, 14 years ago |
Return copy of bbox in Way.getBBox (to make sure internal copy won't be modified)
|
-
Property svn:mime-type
set to
text/plain
|
File size:
1.3 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm;
|
---|
3 |
|
---|
4 | import java.io.FileInputStream;
|
---|
5 | import java.util.ArrayList;
|
---|
6 | import java.util.List;
|
---|
7 |
|
---|
8 | import org.junit.Assert;
|
---|
9 | import org.junit.Test;
|
---|
10 | import org.openstreetmap.josm.Main;
|
---|
11 | import org.openstreetmap.josm.data.projection.Mercator;
|
---|
12 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
|
---|
13 | import org.openstreetmap.josm.io.OsmReader;
|
---|
14 |
|
---|
15 | public class QuadBucketsTest {
|
---|
16 |
|
---|
17 | @Test
|
---|
18 | public void testRemove() throws Exception {
|
---|
19 | Main.proj = new Mercator();
|
---|
20 | DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/restriction.osm"), NullProgressMonitor.INSTANCE);
|
---|
21 | List<Node> allNodes = new ArrayList<Node>(ds.getNodes());
|
---|
22 | List<Way> allWays = new ArrayList<Way>(ds.getWays());
|
---|
23 | List<Relation> allRelations = new ArrayList<Relation>(ds.getRelations());
|
---|
24 | for (OsmPrimitive o: allNodes) {
|
---|
25 | ds.removePrimitive(o);
|
---|
26 | }
|
---|
27 | for (OsmPrimitive o: allWays) {
|
---|
28 | ds.removePrimitive(o);
|
---|
29 | }
|
---|
30 | for (OsmPrimitive o: allRelations) {
|
---|
31 | ds.removePrimitive(o);
|
---|
32 | }
|
---|
33 |
|
---|
34 | Assert.assertTrue(ds.getNodes().isEmpty());
|
---|
35 | Assert.assertTrue(ds.getWays().isEmpty());
|
---|
36 | Assert.assertTrue(ds.getRelations().isEmpty());
|
---|
37 | }
|
---|
38 |
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.