@Test(enabled = false)
public void readUpdateSocketBindings() throws Exception {
ConfigurationDefinition configDef = loadServiceDescriptor("SocketBindingGroupDomain");
Address a = new Address("socket-binding-group=standard-sockets");
ConfigurationLoadDelegate loadDelegate = new ConfigurationLoadDelegate(configDef,
getDomainControllerASConnection(), a);
Configuration conf = loadDelegate.loadResourceConfiguration();
assert conf != null : "Did not get a configuration back";
PropertyList pl = conf.getList("*");
assert pl != null;
List<Property> listContent = pl.getList();
assert !listContent.isEmpty() : "List '*' has no elements";
assert listContent.get(0) instanceof PropertyMap : "List content is no map";
for (Property p : listContent) {
PropertyMap pm = (PropertyMap) p;
Map<String, Property> pmap = pm.getMap();
assert pmap.size() == 6;
PropertySimple name = (PropertySimple) pmap.get("name");
assert name != null;
assert name.getStringValue() != null;
if ("http".equals(name.getStringValue())) {
PropertySimple portProp = (PropertySimple) pmap.get("port");
assert portProp != null;
assert portProp.getStringValue() != null;
portProp.setStringValue("8081");
}
if ("https".equals(name.getStringValue())) {
PropertySimple portProp = (PropertySimple) pmap.get("port");
assert portProp != null;
assert portProp.getStringValue() != null;
portProp.setStringValue("9443");
}
}
// We have changed http port to 8081 and https to 9443, lets write back
ConfigurationWriteDelegate cwd = new ConfigurationWriteDelegate(configDef, getDomainControllerASConnection(), a);
ConfigurationUpdateReport report = new ConfigurationUpdateReport(conf);
cwd.updateResourceConfiguration(report);
assert report.getStatus() == ConfigurationUpdateStatus.SUCCESS;
// now check the result (and change back)
Configuration conf2 = loadDelegate.loadResourceConfiguration();
assert conf2 != null : "Did not get a configuration back";
List<Property> pl2 = conf.getList("*").getList();
for (Property p : pl2) {
PropertyMap pm = (PropertyMap) p;
Map<String, Property> pmap = pm.getMap();