@Test
  public void testServicePackageDirInheritance() throws Exception {
    String assertionTemplate07 = StringUtils.join(
        new String[]{"stacks", "HDP", "2.0.7", "services", "%s", "package"}, File.separator);
    String assertionTemplate08 = StringUtils.join(
        new String[]{"stacks", "HDP", "2.0.8", "services", "%s", "package"}, File.separator);
    // Test service package dir determination in parent
    ServiceInfo service = metaInfo.getService(STACK_NAME_HDP, "2.0.7", "HBASE");
    Assert.assertEquals(String.format(assertionTemplate07, "HBASE"),
            service.getServicePackageFolder());

    service = metaInfo.getService(STACK_NAME_HDP, "2.0.7", "HDFS");
    Assert.assertEquals(String.format(assertionTemplate07, "HDFS"),
            service.getServicePackageFolder());
    // Test service package dir inheritance
    service = metaInfo.getService(STACK_NAME_HDP, "2.0.8", "HBASE");
    Assert.assertEquals(String.format(assertionTemplate07, "HBASE"),
            service.getServicePackageFolder());
    // Test service package dir override
    service = metaInfo.getService(STACK_NAME_HDP, "2.0.8", "HDFS");
    Assert.assertEquals(String.format(assertionTemplate08, "HDFS"),
            service.getServicePackageFolder());
  }
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