@Test public void testResolve_Configuration__attributes() throws Exception { ServiceInfo info = new ServiceInfo(); ServiceInfo parentInfo = new ServiceInfo(); Collection<PropertyInfo> childFooProperties = new ArrayList<PropertyInfo>(); PropertyInfo childProp1 = new PropertyInfo(); childProp1.setName("childName1"); childProp1.setValue("childVal1"); childFooProperties.add(childProp1); Map<String, String> childFooAttributes = new HashMap<String, String>(); childFooAttributes.put(ConfigurationInfo.Supports.ADDING_FORBIDDEN.getXmlAttributeName(), "false"); ConfigurationModule childConfigModule1 = createConfigurationModule("FOO", childFooProperties, childFooAttributes); Collection<ConfigurationModule> childModules = new ArrayList<ConfigurationModule>(); childModules.add(childConfigModule1); Collection<PropertyInfo> parentFooProperties = new ArrayList<PropertyInfo>(); PropertyInfo parentProp1 = new PropertyInfo(); parentProp1.setName("parentName1"); parentProp1.setValue("parentVal1"); parentFooProperties.add(parentProp1); Map<String, String> parentFooAttributes = new HashMap<String, String>(); parentFooAttributes.put(ConfigurationInfo.Supports.FINAL.getXmlAttributeName(), "true"); parentFooAttributes.put(ConfigurationInfo.Supports.ADDING_FORBIDDEN.getXmlAttributeName(), "true"); Collection<PropertyInfo> parentBarProperties = new ArrayList<PropertyInfo>(); PropertyInfo parentProp2 = new PropertyInfo(); parentProp2.setName("parentName2"); parentProp2.setValue("parentVal2"); parentBarProperties.add(parentProp2); ConfigurationModule parentConfigModule1 = createConfigurationModule("FOO", parentFooProperties, parentFooAttributes); ConfigurationModule parentConfigModule2 = createConfigurationModule("BAR", parentBarProperties); Collection<ConfigurationModule> parentModules = new ArrayList<ConfigurationModule>(); parentModules.add(parentConfigModule1); parentModules.add(parentConfigModule2); ServiceModule child = createServiceModule(info, childModules); ServiceModule parent = createServiceModule(parentInfo, parentModules); resolveService(child, parent); Map<String, Map<String, Map<String, String>>> childTypeAttributes = child.getModuleInfo().getConfigTypeAttributes(); Map<String, Map<String, Map<String, String>>> parentTypeAttributes = parent.getModuleInfo().getConfigTypeAttributes(); assertTrue(childTypeAttributes.containsKey("FOO")); Map<String, Map<String, String>> mergedChildFooAttributes = childTypeAttributes.get("FOO"); assertTrue(mergedChildFooAttributes.containsKey(ConfigurationInfo.Supports.KEYWORD)); assertEquals("true", mergedChildFooAttributes.get(ConfigurationInfo.Supports.KEYWORD). get(ConfigurationInfo.Supports.valueOf("FINAL").getPropertyName())); assertEquals("false", mergedChildFooAttributes.get(ConfigurationInfo.Supports.KEYWORD). get(ConfigurationInfo.Supports.valueOf("ADDING_FORBIDDEN").getPropertyName())); assertEquals(2, childTypeAttributes.size()); assertEquals(2, parentTypeAttributes.size()); assertAttributes(parentTypeAttributes.get("FOO"), parentFooAttributes); assertAttributes(parentTypeAttributes.get("BAR"), Collections.<String, String>emptyMap()); }
@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();  }