@Test
  public void testLatestVdf() throws Exception {
    // ensure that all of the latest repo retrieval tasks have completed
    StackManager sm = metaInfo.getStackManager();
    int maxWait = 45000;
    int waitTime = 0;
    while (waitTime < maxWait && ! sm.haveAllRepoUrlsBeenResolved()) {
      Thread.sleep(5);
      waitTime += 5;
    }

    if (waitTime >= maxWait) {
      fail("Latest Repo tasks did not complete");
    }

    // !!! default stack version is from latest-vdf.  2.2.0 only has one entry
    VersionDefinitionXml vdf = metaInfo.getVersionDefinition("HDP-2.2.0");
    assertNotNull(vdf);
    assertEquals(1, vdf.repositoryInfo.getOses().size());

    // !!! this stack has no "manifests" and no "latest-vdf".  So the default VDF should contain
    // information from repoinfo.xml and the "latest" structure
    vdf = metaInfo.getVersionDefinition("HDP-2.2.1");
    assertNotNull(vdf);

    assertEquals(2, vdf.repositoryInfo.getOses().size());
  }
Make sure global mapping is avaliable when global.xml is
in the path.
ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java