@BeforeClass
  public static void beforeClass() {
    URL rootDirectoryURL = KerberosDescriptorTest.class.getResource("/");
    Assert.assertNotNull(rootDirectoryURL);

    File resourcesDirectory = new File(new File(rootDirectoryURL.getFile()).getParentFile().getParentFile(), "src/main/resources");
    Assert.assertNotNull(resourcesDirectory);
    Assert.assertTrue(resourcesDirectory.canRead());

    stacksDirectory = new File(resourcesDirectory, "stacks");
    Assert.assertNotNull(stacksDirectory);
    Assert.assertTrue(stacksDirectory.canRead());

    commonServicesDirectory = new File(resourcesDirectory, "common-services");
    Assert.assertNotNull(commonServicesDirectory);
    Assert.assertTrue(commonServicesDirectory.canRead());

  }
KerberosDescriptorTest tests the stack- and service-level descriptors for certain stacks
and services
ambari-server/src/test/java/org/apache/ambari/server/stack/KerberosDescriptorTest.java