commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William DeMoss II (JIRA)" <>
Subject [jira] Created: (CONFIGURATION-339) ConfigurationConverter does not handle CompositeConfiguration correctly
Date Mon, 13 Oct 2008 20:10:46 GMT
ConfigurationConverter does not handle CompositeConfiguration correctly

                 Key: CONFIGURATION-339
             Project: Commons Configuration
          Issue Type: Bug
          Components: Interpolation
    Affects Versions: 1.5
         Environment: OS X 10.5.5, java version "1.6.0_07", Java(TM) SE Runtime Environment
(build 1.6.0_07-b06-153)

            Reporter: William DeMoss II

ConfigurationConverter doesn't seem to respect the ordering of a composite configuration.
I am having problems describing the behavior, but I thinks the following test case illustrates
it best:

	public void showBug() {
		PropertiesConfiguration p = new PropertiesConfiguration();
		p.addProperty("foo", "initial");
		p.addProperty("bar", "${foo}");
		p.addProperty("", "override");

		CompositeConfiguration cfg = new CompositeConfiguration();

		// this assertion passes as expected since the subset
		// was added first to the composite configuration
		Assert.assertEquals("override", cfg.getString("bar"));

		// after converting to properties, this assertion fails and
		// reports that the value is 'initial'
		Properties properties = ConfigurationConverter.getProperties(cfg);
		Assert.assertEquals("override", properties.getProperty("bar"));

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message