Map<String, MetaValue> propValues,
String deploymentName,
ComponentType componentType, String componentName)
throws Exception
{
ManagementView mgtView = getManagementView();
DeploymentTemplateInfo dsInfo = mgtView.getTemplate(templateName);
assertNotNull("template " + templateName + " found", dsInfo);
Map<String, ManagedProperty> props = dsInfo.getProperties();
for(String propName : propValues.keySet())
{
ManagedProperty prop = props.get(propName);
// If the property does not exist on the template we don't set it
if(prop == null)
continue;
log.debug("template property before: "+prop.getName()+","+prop.getValue());
assertNotNull("property " + propName + " found in template " + templateName, prop);
prop.setValue(propValues.get(propName));
log.debug("template property after: "+prop.getName()+","+prop.getValue());
}
// Assert map composite
if(dsInfo.getProperties().get("config-property") != null)
assertTrue(dsInfo.getProperties().get("config-property").getMetaType() instanceof MapCompositeMetaType);
mgtView.applyTemplate(deploymentName, dsInfo);
// reload the view
activeView = null;
mgtView = getManagementView();
ManagedComponent dsMC = getManagedComponent(mgtView, componentType, componentName);