private ReservationUpdateRequest CreateSimpleReservationUpdateRequest(int numRequests
                                                                              , int numContainers, long arrival, long deadline, long duration)
        {
            // create a request with a single atomic ask
            ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
            ReservationDefinition    rDef    = new ReservationDefinitionPBImpl();

            rDef.SetArrival(arrival);
            rDef.SetDeadline(deadline);
            if (numRequests > 0)
            {
                ReservationRequests reqs = new ReservationRequestsPBImpl();
                rDef.SetReservationRequests(reqs);
                if (numContainers > 0)
                {
                    ReservationRequest r = ReservationRequest.NewInstance(Org.Apache.Hadoop.Yarn.Api.Records.Resource
                                                                          .NewInstance(1024, 1), numContainers, 1, duration);
                    reqs.SetReservationResources(Sharpen.Collections.SingletonList(r));
                    reqs.SetInterpreter(ReservationRequestInterpreter.RAll);
                }
            }
            request.SetReservationDefinition(rDef);
            request.SetReservationId(ReservationSystemTestUtil.GetNewReservationId());
            return(request);
        }
        public virtual void TestUpdateReservationNoDefinition()
        {
            ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();

            request.SetReservationId(ReservationSystemTestUtil.GetNewReservationId());
            Plan plan = null;

            try
            {
                plan = rrValidator.ValidateReservationUpdateRequest(rSystem, request);
                NUnit.Framework.Assert.Fail();
            }
            catch (YarnException e)
            {
                NUnit.Framework.Assert.IsNull(plan);
                string message = e.Message;
                NUnit.Framework.Assert.IsTrue(message.StartsWith("Missing reservation definition. Please try again by specifying a reservation definition."
                                                                 ));
                Log.Info(message);
            }
        }