Exemple #1
0
        /// <exception cref="System.Exception"/>
        public virtual void TestConfValidation()
        {
            FifoScheduler scheduler = new FifoScheduler();
            Configuration conf      = new YarnConfiguration();

            conf.SetInt(YarnConfiguration.RmSchedulerMinimumAllocationMb, 2048);
            conf.SetInt(YarnConfiguration.RmSchedulerMaximumAllocationMb, 1024);
            try
            {
                scheduler.ServiceInit(conf);
                NUnit.Framework.Assert.Fail("Exception is expected because the min memory allocation is"
                                            + " larger than the max memory allocation.");
            }
            catch (YarnRuntimeException e)
            {
                // Exception is expected.
                NUnit.Framework.Assert.IsTrue("The thrown exception is not the expected one.", e.
                                              Message.StartsWith("Invalid resource scheduler memory"));
            }
        }