@Test
public void testAllocationIncrementVCoreWithUnit() throws Exception {

  Configuration conf = new Configuration();
  conf.set(YarnConfiguration.RESOURCE_TYPES + "." +
      ResourceInformation.VCORES.getName() +
      FairSchedulerConfiguration.INCREMENT_ALLOCATION, "1k");
  FairSchedulerConfiguration fsc = new FairSchedulerConfiguration(conf);
  Resource min = Resources.createResource(0L, 0);
  Resource max = Resources.createResource(Long.MAX_VALUE, Integer.MAX_VALUE);
  Resource increment = fsc.getIncrementAllocation();
  DominantResourceCalculator resourceCalculator =
      new DominantResourceCalculator();
  assertEquals(1000, resourceCalculator.normalize(
      Resources.createResource(0L, 999), min, max, increment)
        .getVirtualCores());
  assertEquals(1000, resourceCalculator.normalize(
      Resources.createResource(0L, 1000), min, max, increment)
        .getVirtualCores());
  assertEquals(2000, resourceCalculator.normalize(
      Resources.createResource(0L, 1001), min, max, increment)
        .getVirtualCores());
}