Changeset 10347 in josm for trunk/test
- Timestamp:
- 2016-06-09T10:58:26+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
r9661 r10347 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertNotNull; 5 6 6 7 import org.junit.BeforeClass; … … 8 9 import org.openstreetmap.josm.JOSMFixture; 9 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.actions.AlignInLineAction.InvalidSelection; 12 import org.openstreetmap.josm.actions.AlignInLineAction.Line; 10 13 import org.openstreetmap.josm.data.coor.EastNorth; 11 14 import org.openstreetmap.josm.data.coor.LatLon; … … 189 192 assertEquals("Wrong y coordinate.", y, coordinate.getY(), LatLon.MAX_SERVER_PRECISION); 190 193 } 194 195 /** 196 * Test that a {@link Line} can be constructed with nodes of different coordinates. 197 * @throws InvalidSelection never 198 */ 199 @Test 200 public void testLineDifferentCoordinates() throws InvalidSelection { 201 assertNotNull(new Line(new Node(new EastNorth(0, 1)), 202 new Node(new EastNorth(0, 2)))); 203 assertNotNull(new Line(new Node(new EastNorth(0, 1)), 204 new Node(new EastNorth(1, 1)))); 205 assertNotNull(new Line(new Node(new EastNorth(0, 1)), 206 new Node(new EastNorth(0+1e-150, 1+1e-150)))); 207 } 208 209 /** 210 * Test that a {@link Line} cannot be constructed with nodes of same coordinates. 211 * @throws InvalidSelection always 212 */ 213 @Test(expected = InvalidSelection.class) 214 public void testLineSameCoordinates1() throws InvalidSelection { 215 new Line(new Node(new EastNorth(0, 1)), 216 new Node(new EastNorth(0, 1))); 217 } 218 219 /** 220 * Test that a {@link Line} cannot be constructed with nodes of same coordinates. 221 * @throws InvalidSelection always 222 */ 223 @Test(expected = InvalidSelection.class) 224 public void testLineSameCoordinates2() throws InvalidSelection { 225 new Line(new Node(new EastNorth(0, 1)), 226 new Node(new EastNorth(0+1e-175, 1+1e-175))); 227 } 191 228 }
Note:
See TracChangeset
for help on using the changeset viewer.