@Test
public void testAllImpossible() throws PlanningException {

  prepareBasicPlan();
  // create an ALL request, with an impossible combination, it should be
  // rejected, and allocation remain unchanged
  ReservationDefinition rr = new ReservationDefinitionPBImpl();
  rr.setArrival(100L);
  rr.setDeadline(120L);
  rr.setRecurrenceExpression(recurrenceExpression);
  ReservationRequests reqs = new ReservationRequestsPBImpl();
  reqs.setInterpreter(ReservationRequestInterpreter.R_ALL);
  ReservationRequest r = ReservationRequest.newInstance(
      Resource.newInstance(1024, 1), 55, 5, 10);
  ReservationRequest r2 = ReservationRequest.newInstance(
      Resource.newInstance(2048, 2), 55, 5, 20);
  List<ReservationRequest> list = new ArrayList<ReservationRequest>();
  list.add(r);
  list.add(r2);
  reqs.setReservationResources(list);
  rr.setReservationRequests(reqs);
  ReservationId reservationID = ReservationSystemTestUtil
      .getNewReservationId();
  boolean result = false;
  try {
    // submit to agent
    result = agent.createReservation(reservationID, "u1", plan, rr);
    fail();
  } catch (PlanningException p) {
    // expected
  }
  // validate results, we expect the second one to be accepted
  assertFalse("Agent-based allocation failed", result);
  assertTrue("Agent-based allocation failed", plan.getAllReservations()
      .size() == 2);
  System.out.println("--------AFTER ALL IMPOSSIBLE ALLOCATION (queue: "
      + reservationID + ")----------");
  System.out.println(plan.toString());
  System.out.println(plan.toCumulativeString());
}