@Override public boolean deleteReservation(ReservationId reservationId, String user, Plan plan) throws PlanningException { return plan.deleteReservation(reservationId); }
@Override public boolean deleteReservation(ReservationId reservationId, String user, Plan plan) throws PlanningException { return plan.deleteReservation(reservationId); } @Override
@Override public boolean deleteReservation(ReservationId reservationId, String user, Plan plan) throws PlanningException { // Delete the existing reservation return plan.deleteReservation(reservationId); }
@Override public boolean deleteReservation(ReservationId reservationId, String user, Plan plan) throws PlanningException { return plan.deleteReservation(reservationId); }
&& Resources.greaterThan(resCalc, totCap, excessCap, ZERO_RESOURCE);) { ReservationAllocation reservation = resIter.next(); plan.deleteReservation(reservation.getReservationId()); excessCap = Resources.subtract(excessCap, reservation.getResourcesAtTime(t));
&& Resources.greaterThan(resCalc, totCap, excessCap, ZERO_RESOURCE);) { ReservationAllocation reservation = resIter.next(); plan.deleteReservation(reservation.getReservationId()); excessCap = Resources.subtract(excessCap, reservation.getResourcesAtTime(t));
ZERO_RESOURCE);) { ReservationAllocation reservation = resIter.next(); plan.deleteReservation(reservation.getReservationId()); excessCap = Resources.subtract(excessCap, reservation.getResourcesAtTime(t));
@Test public void testDeleteNonExistingReservation() { Plan plan = new InMemoryPlan(queueMetrics, policy, agent, totalCapacity, 1L, resCalc, minAlloc, maxAlloc, planName, replanner, true, context); ReservationId reservationID = ReservationSystemTestUtil.getNewReservationId(); // Try to delete a reservation without adding Assert.assertNull(plan.getReservationById(reservationID)); try { plan.deleteReservation(reservationID); Assert.fail("Delete should fail as it does not exist in the plan"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().endsWith("does not exist in the plan")); } catch (PlanningException e) { Assert.fail(e.getMessage()); } Assert.assertNull(plan.getReservationById(reservationID)); }
@Test public void testDeleteNonExistingReservation() { Plan plan = new InMemoryPlan(queueMetrics, policy, agent, totalCapacity, 1L, resCalc, minAlloc, maxAlloc, planName, replanner, true); ReservationId reservationID = ReservationSystemTestUtil.getNewReservationId(); // Try to delete a reservation without adding Assert.assertNull(plan.getReservationById(reservationID)); try { plan.deleteReservation(reservationID); Assert.fail("Delete should fail as it does not exist in the plan"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().endsWith("does not exist in the plan")); } catch (PlanningException e) { Assert.fail(e.getMessage()); } Assert.assertNull(plan.getReservationById(reservationID)); }
plan.deleteReservation(reservationID); } catch (PlanningException e) { Assert.fail(e.getMessage());
plan.deleteReservation(reservationID); } catch (PlanningException e) { Assert.fail(e.getMessage());
plan.deleteReservation(reservationID); } catch (PlanningException e) { Assert.fail(e.getMessage());