/** * Failure test of <code>setWaypoint(int index, Point waypoint)</code> method. * * <p>index is equal to list size. * * <p>Expect IllegalArgumentException. * * @throws Exception throw exception to JUnit. */ public void testSetWaypointFailureIndexEqualToSize() throws Exception { try { polyline.setWaypoint(0, waypoint); fail("Expect IllegalArgumentException."); } catch (IllegalArgumentException e) { // expect } }
/** * Failure test of <code>setWaypoint(int index, Point waypoint)</code> method. * * <p>index is negative. * * <p>Expect IllegalArgumentException. * * @throws Exception throw exception to JUnit. */ public void testSetWaypointFailureNegativeIndex() throws Exception { try { polyline.setWaypoint(-1, waypoint); fail("Expect IllegalArgumentException."); } catch (IllegalArgumentException e) { // expect } }
/** * Failure test of <code>setWaypoint(int index, Point waypoint)</code> method. * * <p>waypoint is null. * * <p>Expect IllegalArgumentException. * * @throws Exception throw exception to JUnit. */ public void testSetWaypointFailureNullWaypoint() throws Exception { polyline.addWaypoint(waypoint); try { polyline.setWaypoint(0, null); fail("Expect IllegalArgumentException."); } catch (IllegalArgumentException e) { // expect } }