commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject [Configuration] Issue with subset and substitution
Date Mon, 29 Mar 2004 16:55:57 GMT
Hello folks,

today I've build a SNAPSHOT version of configurations and with the new subsets I got a failed
unit test in my own application. I've boiled it down to something in commons-configuration
that worked before the subset refactoring:


    /**
     * Tests subsets and still can resolve elements
     */
    public void testSubsetCanResolve() throws Exception
    {
        cc = new CompositeConfiguration();
        final BaseConfiguration config = new BaseConfiguration();
        config.addProperty("subset.tempfile", "${java.io.tmp}/file.tmp");
        cc.addConfiguration(config);
        cc.addConfiguration(ConfigurationConverter.getConfiguration(System.getProperties()));

        Configuration subset = cc.subset("subset");
        assertEquals(System.getProperty("java.io.tmp") + "/file.tmp", subset.getString("tempfile"));
    }


If you have a closer look, it is quite obvious, why it does not work, since "subset" will
mask now anything including the system properties. It seems that the values were resolved
first in the previous version ...

Comments?

Regards,
Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message