private ReservationSubmissionRequest CreateSimpleReservationSubmissionRequest(int
                                                                                      numRequests, int numContainers, long arrival, long deadline, long duration)
        {
            // create a request with a single atomic ask
            ReservationSubmissionRequest request = new ReservationSubmissionRequestPBImpl();
            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.SetQueue(PlanName);
            request.SetReservationDefinition(rDef);
            return(request);
        }
        public virtual void TestSubmitReservationNoDefinition()
        {
            ReservationSubmissionRequest request = new ReservationSubmissionRequestPBImpl();

            request.SetQueue(PlanName);
            Plan plan = null;

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