@Test
public void testAnyImpossible() throws PlanningException {

  prepareBasicPlan();
  // create an ANY request, with all impossible alternatives
  ReservationDefinition rr = new ReservationDefinitionPBImpl();
  rr.setArrival(100L);
  rr.setDeadline(120L);
  rr.setRecurrenceExpression(recurrenceExpression);
  ReservationRequests reqs = new ReservationRequestsPBImpl();
  reqs.setInterpreter(ReservationRequestInterpreter.R_ANY);
  // longer than arrival-deadline
  ReservationRequest r1 = ReservationRequest.newInstance(
      Resource.newInstance(1024, 1), 35, 5, 30);
  // above max cluster size
  ReservationRequest r2 = ReservationRequest.newInstance(
      Resource.newInstance(1024, 1), 110, 110, 10);
  List<ReservationRequest> list = new ArrayList<ReservationRequest>();
  list.add(r1);
  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 should have failed", result);
  assertTrue("Agent-based allocation should have failed", plan
      .getAllReservations().size() == 2);
  System.out.println("--------AFTER ANY IMPOSSIBLE ALLOCATION (queue: "
      + reservationID + ")----------");
  System.out.println(plan.toString());
  System.out.println(plan.toCumulativeString());
}