commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathan doklovic <list-rea...@sysbliss.com>
Subject Commons Config Interpolation not working
Date Fri, 07 Mar 2008 17:56:13 GMT
Hi,

I'm using commons-config-1.5
I have created a Configuration class that extends CombinedConfiguration
and I can't get property interpolation to work.

I decided to step back and just try a simple test case, and I can get
that to work either. Here's what I have:

testPropExpansion.properties
-----------------------------
base.prop=root
client.prop=got ${base.prop}?


TestPropertyExpansion.java
-----------------------------
@Test
public void genericExpansion() throws Exception {
    File props = new File("testPropExpansion.properties");
    Configuration cfg = new PropertiesConfiguration(props);
    assert cfg.getProperty("client.prop").equals("got root?") :
"expected: got root? received: " + cfg.getProperty("client.prop");

}


Test output
--------------
genericExpansion - Failure - expected: got root? received: got
${base.prop}?

java.lang.AssertionError: expected: got root? received: got
${base.prop}?
at
com.ibsys.headline.config.TestPropertyExpansion.genericExpansion(TestPropertyExpansion.java:17)
... Removed 22 stack frames

Why is this test failing?

- Jonathan



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


Mime
View raw message