assertTrue(rm.equalPosition(v1, p1)); pm.service(v1, p1, create(NonSI.HOUR, 0, 1));
/** * It is not allowed to go to a delivery location twice. */ @Test(expected = IllegalArgumentException.class) public void attemptVisitFor3rdTime2() { // first pickup rm.moveTo(dv1, dp1, time(11)); assertTrue(rm.equalPosition(dv1, dp1)); rm.removeObject(dp1); // then deliver rm.moveTo(dv1, dp1, time(80)); assertEquals(rm.getPosition(dv1), dp1.getDeliveryLocation()); rm.moveTo(dv1, dp2, time(180)); assertTrue(rm.equalPosition(dv1, dp2)); rm.removeObject(dp2); // it is not allowed to revisit this position rm.moveTo(dv1, dp1, time(80)); }
/** * */ @Test public void brokenWaitState() { d.setRoute(asList(p1)); tick(4, 5, 30); assertEquals(d.gotoState, d.stateMachine.getCurrentState()); if (allowDelayedRouteChanges) { d.setRoute(Arrays.<Parcel>asList()); rm.moveTo(d, p1, time(minute(0), minute(10))); assertTrue(rm.equalPosition(d, p1)); pm.pickup(d, p1, time(minute(16), minute(17))); assertEquals(VehicleState.PICKING_UP, pm.getVehicleState(d)); if (diversionIsAllowed) { boolean exception = false; try { tick(5, 6); } catch (final IllegalStateException e) { exception = true; } assertTrue(exception); } } }