Changeset 11440 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2017-01-07T17:15:00+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java
r11115 r11440 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import java.util.Arrays; 5 import java.util.List; 6 7 import org.junit.Assert; 4 8 import org.junit.Rule; 5 9 import org.junit.Test; 6 import org. junit.Assert;10 import org.openstreetmap.josm.data.coor.LatLon; 7 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 8 12 9 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 10 import java.util.List;11 import org.openstreetmap.josm.data.coor.LatLon;12 14 13 15 /** … … 34 36 ds.searchRelations(null).isEmpty() 35 37 ); 36 38 37 39 // empty data set, any bbox => empty list 38 BBox bbox = new BBox( LatLon.NORTH_POLE, LatLon.SOUTH_POLE);40 BBox bbox = new BBox(new LatLon(-180, -90), new LatLon(180, 90)); 39 41 Assert.assertTrue( 40 42 "Empty data set should produce an empty list.", 41 43 ds.searchRelations(bbox).isEmpty() 42 44 ); 43 45 44 46 // data set with elements in the given bbox => these elements 45 47 Node node = new Node(LatLon.ZERO); … … 53 55 Assert.assertEquals("We should have found only one item.", 1, result.size()); 54 56 Assert.assertTrue("The item found is relation r.", result.contains(r)); 55 57 } 58 59 /** 60 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/14186">Bug #14186</a>. 61 */ 62 @Test 63 public void testTicket14186() { 64 final DataSet ds = new DataSet(); 65 Node n1 = new Node(1); 66 Node n2 = new Node(2); 67 Node n3 = new Node(3); 68 Way w1 = new Way(1); 69 w1.setNodes(Arrays.asList(n1, n2, n3)); 70 Way w2 = new Way(2); 71 w2.setNodes(Arrays.asList(n1, n2, n3)); 72 ds.addPrimitive(n1); 73 ds.addPrimitive(n2); 74 ds.addPrimitive(n3); 75 ds.addPrimitive(w1); 76 ds.addPrimitive(w2); 77 ds.unlinkNodeFromWays(n2); 56 78 } 57 79 }
Note:
See TracChangeset
for help on using the changeset viewer.