map.put(ps);
PropertyList pl = (PropertyList) configuration.get("*");
pl.add(map);
ConfigurationUpdateRequest request = new ConfigurationUpdateRequest(1, configuration, getResource().getId());
ConfigurationUpdateResponse response = pluginContainer.getConfigurationManager()
.executeUpdateResourceConfigurationImmediately(request);
assert response != null;
assert response.getErrorMessage() == null : "Config add resulted in this error: " + response.getErrorMessage();
configuration = loadConfig();
map = null;
pl = (PropertyList) configuration.get("*");
for (Property prop : pl.getList()) {
PropertyMap pm = (PropertyMap) prop;
PropertySimple ps2 = pm.getSimple("name");
if (!ps2.getStringValue().equals("bla2"))
continue;
map = pm;
}
assert map != null : "Did not find 'bla2' in the returned config";
map.put(new PropertySimple(PORT_EXPR, 22355));
map.put(new PropertySimple("fixed-port", true));
request = new ConfigurationUpdateRequest(2, configuration, getResource().getId());
response = pluginContainer.getConfigurationManager().executeUpdateResourceConfigurationImmediately(request);
assert response != null;
assert response.getErrorMessage() == null : "Config update resulted in this error: "
+ response.getErrorMessage();
}