Changeset 10347 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r10308 r10347 56 56 57 57 /** 58 * InvalidSelection exception has to be raised when action can't be perform 59 */ 60 privatestatic class InvalidSelection extends Exception {58 * InvalidSelection exception has to be raised when action can't be performed 59 */ 60 static class InvalidSelection extends Exception { 61 61 62 62 /** … … 69 69 /** 70 70 * Create an InvalidSelection exception with specific message 71 * @param msg Message that will be display to the user71 * @param msg Message that will be displayed to the user 72 72 */ 73 73 InvalidSelection(String msg) { … … 343 343 * Class that represent a line 344 344 */ 345 privatestatic class Line {345 static class Line { 346 346 347 347 /** -
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.