@Test public void testResolve_Components() throws Exception { ComponentInfo info1 = new ComponentInfo(); info1.setName("1"); ComponentInfo info2 = new ComponentInfo(); info2.setName("2"); ComponentInfo XX = new ComponentInfo(); XX.setName("XX"); ComponentInfo info3 = new ComponentInfo(); info3.setName("1"); info3.setCardinality("ALL"); info3.setCategory("category"); ComponentInfo info4 = new ComponentInfo(); info4.setName("4"); ComponentInfo info5 = new ComponentInfo(); info5.setName("XX"); info5.setDeleted(true); ServiceInfo info = new ServiceInfo(); ServiceInfo parentInfo = new ServiceInfo(); List<ComponentInfo> childComponents = info.getComponents(); childComponents.add(info3); childComponents.add(info4); childComponents.add(info5); List<ComponentInfo> parentComponents = parentInfo.getComponents(); parentComponents.add(info1); parentComponents.add(info2); ServiceModule child = createServiceModule(info); ServiceModule parent = createServiceModule(parentInfo); resolveService(child, parent); List<ComponentInfo> components = child.getModuleInfo().getComponents(); assertEquals(3, components.size()); Map<String, ComponentInfo> mergedComponents = new HashMap<String, ComponentInfo>(); for (ComponentInfo component : components) { mergedComponents.put(component.getName(), component); } assertTrue(mergedComponents.containsKey("1")); assertTrue(mergedComponents.containsKey("2")); assertTrue(mergedComponents.containsKey("4")); assertEquals("ALL", mergedComponents.get("1").getCardinality()); assertEquals("category", mergedComponents.get("1").getCategory()); }
@Override public ServiceInfo getModuleInfo() { return serviceInfo; }
ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implements Validable { @Override public ServiceInfo getModuleInfo() { return serviceInfo; } }
ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implements Validable { @Override public ServiceInfo getModuleInfo() { return serviceInfo; } ServiceModule(StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory);  ServiceModule(
      StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory, boolean isCommonService); }
ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implements Validable { @Override public ServiceInfo getModuleInfo() { return serviceInfo; } ServiceModule(StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory);  ServiceModule(
      StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory, boolean isCommonService); @Override ServiceInfo getModuleInfo(); @Override void resolve(
      ServiceModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions); void resolveExplicit(
      ServiceModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions); void resolveInternal(
      ServiceModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices,
      Map<String, ExtensionModule> extensions, boolean resolveExplicit); void resolveCommonService(Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions); @Override boolean isDeleted(); @Override String getId(); @Override void finalizeModule(); @Override boolean isValid(); @Override void setValid(boolean valid); @Override void addError(String error); @Override Collection<String> getErrors(); ServiceDirectory getServiceDirectory(); @Override void addErrors(Collection<String> errors); @Override String toString(); }
ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implements Validable { @Override public ServiceInfo getModuleInfo() { return serviceInfo; } ServiceModule(StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory);  ServiceModule(
      StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory, boolean isCommonService); @Override ServiceInfo getModuleInfo(); @Override void resolve(
      ServiceModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions); void resolveExplicit(
      ServiceModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions); void resolveInternal(
      ServiceModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices,
      Map<String, ExtensionModule> extensions, boolean resolveExplicit); void resolveCommonService(Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions); @Override boolean isDeleted(); @Override String getId(); @Override void finalizeModule(); @Override boolean isValid(); @Override void setValid(boolean valid); @Override void addError(String error); @Override Collection<String> getErrors(); ServiceDirectory getServiceDirectory(); @Override void addErrors(Collection<String> errors); @Override String toString();  }