You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tamaya.apache.org by "P. Ottlinger" <po...@apache.org> on 2018/06/05 19:52:06 UTC
Re: incubator-tamaya git commit: TAMAYA-340 Enhanced environment
property resolution.
Hi Anatole,
thanks for your commits ....
being curious as I am I took a look at the test:
org.apache.tamaya.spisupport.propertysource.EnvironmentPropertySourceTest.testPrefixedGet()
and was starting to wonder if the javadoc is correct or if I don't get
the class' functionality.
I'd guess the test case to hold, but initializing it without a prefix
but setting it as System property does not work, as the prefix is null.
Should the prefix be filtered out as the Javadoc suggests
org.apache.tamaya.spisupport.propertysource.EnvironmentPropertySource
(line 71ff)
I had expected something like:
* $ java -Dtamaya.envprops.prefix=a81 -jar application.jar
* </pre>
*
* <p>The application specific value can now be accessed from the code
of the
* application like this:</p>
*
* <pre>
* PropertySource ps = new EnvironmentPropertySource();
* PropertyValue pv = ps.get("CUSTOMER");
* System.out.println(pv.getValue());
* </pre>
shouldn't ps.getPrefix() == "a81" hold?!
It's only set if I initalize the property source as
PropertySource ps = new EnvironmentPropertySource("a81");
Is that a bug? or is there an order implied that I don't see yet.
Thanks,
Phil