@Test public void testGetStackServiceInheritance() { StackInfo baseStack = stackManager.getStack("OTHER", "1.0"); StackInfo stack = stackManager.getStack("OTHER", "2.0"); assertEquals(5, stack.getServices().size()); ServiceInfo service = stack.getService("SQOOP2"); ServiceInfo baseSqoopService = baseStack.getService("SQOOP2"); assertEquals("SQOOP2", service.getName()); assertEquals("Inherited from parent", service.getComment()); assertEquals("Extended from parent version", service.getVersion()); assertNull(service.getServicePackageFolder()); List<ComponentInfo> serviceComponents = service.getComponents(); List<ComponentInfo> baseStormServiceCompoents = baseSqoopService.getComponents(); assertEquals(serviceComponents, baseStormServiceCompoents); assertEquals(baseSqoopService.isDeleted(), service.isDeleted()); assertEquals(baseSqoopService.getAlertsFile(),service.getAlertsFile()); assertEquals(baseSqoopService.getClientComponent(), service.getClientComponent()); assertEquals(baseSqoopService.getCommandScript(), service.getCommandScript()); assertEquals(baseSqoopService.getConfigDependencies(), service.getConfigDependencies()); assertEquals(baseSqoopService.getConfigDir(), service.getConfigDir()); assertEquals(baseSqoopService.getConfigDependenciesWithComponents(), service.getConfigDependenciesWithComponents()); assertEquals(baseSqoopService.getConfigTypeAttributes(), service.getConfigTypeAttributes()); assertEquals(baseSqoopService.getCustomCommands(), service.getCustomCommands()); assertEquals(baseSqoopService.getExcludedConfigTypes(), service.getExcludedConfigTypes()); assertEquals(baseSqoopService.getProperties(), service.getProperties()); assertEquals(baseSqoopService.getMetrics(), service.getMetrics()); assertNull(baseSqoopService.getMetricsFile()); assertNull(service.getMetricsFile()); assertEquals(baseSqoopService.getOsSpecifics(), service.getOsSpecifics()); assertEquals(baseSqoopService.getRequiredServices(), service.getRequiredServices()); assertEquals(baseSqoopService.getSchemaVersion(), service.getSchemaVersion()); }
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; }