@Test(timeout = 30000)
public void testConfValidation() throws Exception {

  FifoScheduler scheduler = new FifoScheduler();
  Configuration conf = new YarnConfiguration();
  conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 2048);
  conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, 1024);
  try {
    scheduler.serviceInit(conf);
    fail("Exception is expected because the min memory allocation is"
        + " larger than the max memory allocation.");
  } catch (YarnRuntimeException e) {
    // Exception is expected.
    assertTrue("The thrown exception is not the expected one.", e
        .getMessage().startsWith("Invalid resource scheduler memory"));
  }
}