@Test public void testClientConfigFilesInheritance() throws Exception{ StackInfo stack = stackManager.getStack("HDP", "2.0.6"); ServiceInfo zkService = stack.getService("ZOOKEEPER"); List<ComponentInfo> components = zkService.getComponents(); assertTrue(components.size() == 2); ComponentInfo componentInfo = components.get(1); List<ClientConfigFileDefinition> clientConfigs = componentInfo.getClientConfigFiles(); assertEquals(2,clientConfigs.size()); assertEquals("zookeeper-env",clientConfigs.get(0).getDictionaryName()); assertEquals("zookeeper-env.sh",clientConfigs.get(0).getFileName()); assertEquals("env",clientConfigs.get(0).getType()); assertEquals("zookeeper-log4j",clientConfigs.get(1).getDictionaryName()); assertEquals("log4j.properties",clientConfigs.get(1).getFileName()); assertEquals("env", clientConfigs.get(1).getType()); }
public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } @AssistedInject  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao); }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } @AssistedInject  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao); StackInfo getStack(String name, String version); Collection<StackInfo> getStacks(String name); Collection<StackInfo> getStacks(); ExtensionInfo getExtension(String name, String version); Collection<ExtensionInfo> getExtensions(String name); Collection<ExtensionInfo> getExtensions(); boolean haveAllRepoUrlsBeenResolved(); static Validator getPropertySchemaValidator(); static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator); void linkStackToExtension(StackInfo stack, ExtensionInfo extension); void unlinkStackAndExtension(StackInfo stack, ExtensionInfo extension); }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } @AssistedInject  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao); StackInfo getStack(String name, String version); Collection<StackInfo> getStacks(String name); Collection<StackInfo> getStacks(); ExtensionInfo getExtension(String name, String version); Collection<ExtensionInfo> getExtensions(String name); Collection<ExtensionInfo> getExtensions(); boolean haveAllRepoUrlsBeenResolved(); static Validator getPropertySchemaValidator(); static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator); void linkStackToExtension(StackInfo stack, ExtensionInfo extension); void unlinkStackAndExtension(StackInfo stack, ExtensionInfo extension); static final String PROPERTY_SCHEMA_PATH; static String PATH_DELIMITER; static final String COMMON_SERVICES; static final String EXTENSIONS; static final String METAINFO_FILE_NAME; }