Changeset 14960 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-04-04T11:34:48+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java
r11630 r14960 12 12 import org.openstreetmap.josm.data.Bounds; 13 13 import org.openstreetmap.josm.data.DataSource; 14 import org.openstreetmap.josm.data.coor.EastNorth; 14 15 import org.openstreetmap.josm.data.coor.LatLon; 15 16 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 27 28 @Rule 28 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules() ;30 public JOSMTestRules test = new JOSMTestRules().projection(); 30 31 31 32 /** … … 104 105 new Node().load(new WayData()); 105 106 } 107 108 /** 109 * Test that {@link Node#isOutSideWorld} works as expected. 110 */ 111 @Test 112 public void testOutsideWorld() { 113 Node n = new Node(1, 1); 114 n.setCoor(LatLon.ZERO); 115 assertFalse(n.isOutSideWorld()); 116 n.setCoor(null); 117 assertFalse(n.isOutSideWorld()); 118 n.setCoor(LatLon.NORTH_POLE); 119 assertTrue(n.isOutSideWorld()); 120 n.setCoor(new LatLon(0, 180.0)); 121 assertFalse(n.isOutSideWorld()); 122 // simulate a small move east 123 n.setEastNorth(new EastNorth(n.getEastNorth().getX() + 0.1, n.getEastNorth().getY())); 124 assertTrue(n.isOutSideWorld()); 125 n.setCoor(new LatLon(0, -180.0)); 126 assertFalse(n.isOutSideWorld()); 127 // simulate a small move west 128 n.setEastNorth(new EastNorth(n.getEastNorth().getX() - 0.1, n.getEastNorth().getY())); 129 assertTrue(n.isOutSideWorld()); 130 } 131 106 132 }
Note:
See TracChangeset
for help on using the changeset viewer.