// .being made into the DefaultDS.xml file
Resource platform = discoverPlatform();
Resource defaultDs = findService("DefaultDS", SERVER_NAME, platform);
PluginContainer pc = PluginContainer.getInstance();
ConfigurationAgentService configService = pc.getConfigurationAgentService();
Configuration configuration = configService.loadResourceConfiguration(defaultDs.getId());
// Sanity check, to make sure jndi name is as we expect it
assert configuration != null : "Configuration for Default DS was null";
assert configuration.getSimple("jndi-name").getStringValue().equals("DefaultDS") : "Property jndiName was incorrect";
// Change a value and update
//configuration = configuration.deepCopy();
configuration.put(new PropertySimple("jndi-name", "TestDS"));
configuration.put(new PropertySimple("max-pool-size", "100"));
ConfigurationUpdateRequest cur = new ConfigurationUpdateRequest(0, configuration, defaultDs.getId());
configService.updateResourceConfiguration(cur);
// Verify changes are in place
configuration = configService.loadResourceConfiguration(defaultDs.getId());
assert configuration.getSimple("jndi-name").getStringValue().equals("TestDS") : "Updated property jndiName was incorrect";
assert configuration.getSimple("max-pool-size").getStringValue().equals("100") : "Updated property max-pool-size was incorrect";
// Rollback changes (find a better way of doing this)
configuration.put(new PropertySimple("jndi-name", "DefaultDS"));
configuration.put(new PropertySimple("max-pool-size", "20"));
cur.setConfiguration(configuration);
configService.updateResourceConfiguration(cur);
}